From 0c9cb2786f17c8fd0d3f504ca920c37b2b1bcb8d Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Sat, 30 Jan 2021 17:36:17 -0800 Subject: [PATCH] Fix emscripten builds by correcting `ctype.h` include. The emscripten compat headers work by transparently augmenting imports and including the original headers via `#include_next`. The search path for emscripten places `system/include/compat` before `system/include`, and so importing with `compat/ctype.h` causes the preprocessor to skip over `system/include/compat` and land the search cursor on `system/include`, which then causes the subsequent `#include_next ` lookup to fail while processing the compat header. Fixes emscripten-core/emscripten#13109 and bkaradzic/bgfx#2336. --- src/image_decode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/image_decode.cpp b/src/image_decode.cpp index a569134..5430944 100644 --- a/src/image_decode.cpp +++ b/src/image_decode.cpp @@ -17,7 +17,7 @@ BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // error C4100: '' : unreferenced formal BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4389) // warning C4389 : '==' : signed / unsigned mismatch BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4505) // warning C4505: 'tinyexr::miniz::def_realloc_func': unreferenced local function has been removed #if BX_PLATFORM_EMSCRIPTEN -# include +# include #endif // BX_PLATFORM_EMSCRIPTEN #define MINIZ_NO_ARCHIVE_APIS #define MINIZ_NO_STDIO