From d658ef662798294b2d33bfabe2e084b9fba7f6a1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 18 Sep 2024 10:29:04 -0700
Subject: [PATCH] Don't guess about the size of an int, assert it!
---
src/audio/SDL_wave.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/audio/SDL_wave.c b/src/audio/SDL_wave.c
index 181f504ea552e..6666072f6a740 100644
--- a/src/audio/SDL_wave.c
+++ b/src/audio/SDL_wave.c
@@ -23,8 +23,9 @@
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
+#undef INT_MAX
#ifndef INT_MAX
-// Make a lucky guess.
+SDL_COMPILE_TIME_ASSERT(int_size, sizeof(int) == sizeof(Sint32));
#define INT_MAX SDL_MAX_SINT32
#endif
#ifndef SIZE_MAX