diff --git a/test/support/counting.hpp b/test/support/counting.hpp index 310c665..5b91b17 100644 --- a/test/support/counting.hpp +++ b/test/support/counting.hpp @@ -242,6 +242,14 @@ void __libc_free(void*); #define WEBCPP_TEST_C(name) __libc_##name // glibc declares these with __THROW, noexcept in C++11 and later: a replacement must match. #define WEBCPP_TEST_C_NOEXCEPT noexcept +// Clang's , which the x86 intrinsic headers include (, included by +// Boost.URL and Boost.JSON among others), redeclares posix_memalign without an exception +// specification. Clang accepts that redeclaration only when the declaration before it is a +// system header's (glibc's), so comes before the replacement below: included after +// it, it fails to compile ("'posix_memalign' is missing exception specification"). +#if __has_include() +#include +#endif #else #define WEBCPP_TEST_C(name) emscripten_builtin_##name // Emscripten's musl declares them without an exception specification.