diff --git a/stb_vorbis.c b/stb_vorbis.c index 19459eb1a354eee2de0204b3bc8ee6fe5185441c..c4f24d58985d31c25e992a6930a060aa694d8dbc 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 -#if !(defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)) -#include -#if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) -#include -#endif -#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