Sfoglia il codice sorgente

Fixed warning C6255: _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.

Sam Lantinga 1 anno fa
parent
commit
21f273ecc7
1 ha cambiato i file con 3 aggiunte e 0 eliminazioni
  1. 3 0
      src/SDL_internal.h

+ 3 - 0
src/SDL_internal.h

@@ -44,6 +44,9 @@
 #define HAVE_GCC_DIAGNOSTIC_PRAGMA 1
 #endif
 
+#ifdef _MSC_VER // SDL_MAX_SMALL_ALLOC_STACKSIZE is smaller than _ALLOCA_S_THRESHOLD and should be generally safe
+#pragma warning(disable : 6255)
+#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) \