瀏覽代碼

clarify alloca #include whitelists

Sean Barrett 9 年之前
父節點
當前提交
14e6a98469
共有 1 個文件被更改,包括 16 次插入14 次删除
  1. 16 14
      stb_vorbis.c

+ 16 - 14
stb_vorbis.c

@@ -549,21 +549,23 @@ enum STBVorbisError
 #endif
 #endif
 
 
 #ifndef STB_VORBIS_NO_CRT
 #ifndef STB_VORBIS_NO_CRT
-#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
-#include <math.h>
-#ifdef _MSC_VER
-#include <malloc.h>
-#endif
-#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__)
-#include <alloca.h>
-#endif
+   #include <stdlib.h>
+   #include <string.h>
+   #include <assert.h>
+   #include <math.h>
+
+   // find definition of alloca if it's not in stdlib.h:
+   #ifdef _MSC_VER
+      #include <malloc.h>
+   #endif
+   #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__)
+      #include <alloca.h>
+   #endif
 #else // STB_VORBIS_NO_CRT
 #else // STB_VORBIS_NO_CRT
-#define NULL 0
-#define malloc(s)   0
-#define free(s)     ((void) 0)
-#define realloc(s)  0
+   #define NULL 0
+   #define malloc(s)   0
+   #define free(s)     ((void) 0)
+   #define realloc(s)  0
 #endif // STB_VORBIS_NO_CRT
 #endif // STB_VORBIS_NO_CRT
 
 
 #include <limits.h>
 #include <limits.h>