From 14e6a98469d8f378e5f6a1d77d166244fe452d6c Mon Sep 17 00:00:00 2001 From: Sean Barrett Date: Sat, 27 Aug 2016 12:10:46 -0700 Subject: [PATCH] clarify alloca #include whitelists --- stb_vorbis.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index 620440d..c4f24d5 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -549,21 +549,23 @@ enum STBVorbisError #endif #ifndef STB_VORBIS_NO_CRT -#include -#include -#include -#include -#ifdef _MSC_VER -#include -#endif -#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) -#include -#endif + #include + #include + #include + #include + + // find definition of alloca if it's not in stdlib.h: + #ifdef _MSC_VER + #include + #endif + #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) + #include + #endif #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 #include