add HAVE_GCC_DIAGNOSTIC_PRAGMA to SDL_internal.h, use it

This commit is contained in:
Ozkan Sezer
2023-11-23 11:33:20 +03:00
parent 42c8366fdc
commit 5730eb67f0
9 changed files with 34 additions and 14 deletions

View File

@@ -40,6 +40,10 @@
#define SDL_VARIABLE_LENGTH_ARRAY
#endif
#if (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))) || defined(__clang__)
#define HAVE_GCC_DIAGNOSTIC_PRAGMA 1
#endif
#define SDL_MAX_SMALL_ALLOC_STACKSIZE 128
#define SDL_small_alloc(type, count, pisstack) ((*(pisstack) = ((sizeof(type) * (count)) < SDL_MAX_SMALL_ALLOC_STACKSIZE)), (*(pisstack) ? SDL_stack_alloc(type, count) : (type *)SDL_malloc(sizeof(type) * (count))))
#define SDL_small_free(ptr, isstack) \