eblot / homebrew-armeabi

Homebrew tap for ARM EABI toolchain
MIT License
43 stars 11 forks source link

Fix `#include <cstdlib>` and siblings #8

Closed burnpanck closed 4 years ago

burnpanck commented 4 years ago

Due to an implementation detail of libstdc++, it seems the include paths for the C standard library headers need to come after the include path for the C++ library headers: cstdlib does #include_next <stdlib.h> which will skip any include path before the one that found the C++ library header. Apparently, the reason for #include_next is because the C++ standard library has to provide it's own stdlib.h which does not necessarily match the C standard library header exactly.

In any case, for me, without this fix, even the most simple main.cpp with just #include <cstdlib> would not compile. With this fix, it does.

eblot commented 4 years ago

Seems fair. Thanks for the patch.

I think that now that GitHub actions are available, I should add some unit tests to avoid this kind of mistakes...