Explorar o código

Don't guess about the size of an int, assert it!

Sam Lantinga hai 1 ano
pai
achega
d658ef6627
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/audio/SDL_wave.c

+ 2 - 1
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