Closed bdero closed 3 years ago
One caveat here is that I'm not sure how importing via compat/ctype.h
worked at some point in the past. The compat header hasn't changed for 7 years and this include hasn't changed since the bimg repo was created 4 years ago.
My best guess is that emscripten removed a 3rd/redundant search path at some point which offered the same contents as system/include
, and so importing via `compat/ctype.h' just happened to work unintentionally.
SInce you're already there... ctype.h was needed for tinyexr. What happens if you completely remove it? If it's not needed anymore it would be better to not be there. Or if it's needed just add comment what's needed.
Yup, I don't think it's needed anymore. Just tried removing it and it builds: #52
Cool! Thanks!
The emscripten compat headers work by transparently augmenting imports and including the original headers via
#include_next
. The search path for emscripten placessystem/include/compat
beforesystem/include
, and so importing withcompat/ctype.h
causes the preprocessor to skip oversystem/include/compat
and land the search cursor onsystem/include
, which then causes the subsequent#include_next <ctype.h>
lookup to fail while processing the compat header.Fixes emscripten-core/emscripten#13109. Fixes bkaradzic/bgfx#2336.