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

This commit is contained in:
Sam Lantinga 2024-09-18 10:29:04 -07:00
parent 32fd1878a0
commit d658ef6627
1 changed files with 2 additions and 1 deletions

View File

@ -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