From 47a3c4f5b5153a361b73a008770dc57c064d2502 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 24 Apr 2020 18:34:59 +0100 Subject: [PATCH 1/2] stb_vorbis.c - Detect `__NEWLIB__` for `alloca.h` This is needed for `stb_vorbis.c` to compile for the Wii U using devkitPro. This should theoretically also fix compilation for the Nintendo Switch, 3DS, and Wii (with devkitPro, that is) as they all also use Newlib. Newlib is also used by Cygwin: https://cygwin.com/git/?p=newlib-cygwin.git;a=blob;f=newlib/libc/include/alloca.h;h=5d36318914282280b353aed457e1b1f64947b584;hb=HEAD And the Google Native Client: https://chromium.googlesource.com/native_client/nacl-newlib/+/refs/heads/master/newlib/libc/include/alloca.h As you can see from these links, these both provide `alloca.h` as well, so it appears to be a safe guarantee that `alloca.h` is available on Newlib. --- stb_vorbis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index b28944a..3991d8e 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -577,7 +577,7 @@ enum STBVorbisError #if defined(_MSC_VER) || defined(__MINGW32__) #include #endif - #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) + #if defined(__linux__) || defined(__linux) || defined(__EMSCRIPTEN__) || defined(__NEWLIB__) #include #endif #else // STB_VORBIS_NO_CRT From d8df5e99748307e2f4f774f79142372b07b4c406 Mon Sep 17 00:00:00 2001 From: Clownacy Date: Fri, 24 Apr 2020 18:46:28 +0100 Subject: [PATCH 2/2] Add myself to the list of contributors The pull-request template says to do so. --- stb_vorbis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stb_vorbis.c b/stb_vorbis.c index 3991d8e..37149a3 100644 --- a/stb_vorbis.c +++ b/stb_vorbis.c @@ -31,7 +31,7 @@ // Phillip Bennefall Rohit Thiago Goulart // github:manxorist saga musix github:infatum // Timur Gagiev Maxwell Koo Peter Waller -// github:audinowho Dougall Johnson +// github:audinowho Dougall Johnson github:Clownacy // // Partial history: // 1.19 - 2020-02-05 - warnings