diff --git a/Sources/_TestingInternals/include/Includes.h b/Sources/_TestingInternals/include/Includes.h index 1b95151cb..869fcff2a 100644 --- a/Sources/_TestingInternals/include/Includes.h +++ b/Sources/_TestingInternals/include/Includes.h @@ -29,6 +29,12 @@ #include #include #include +/// limits.h must be included before stdlib.h with glibc, otherwise the +/// fortified realpath() in this module will differ from the one in SwiftGlibc. +/// glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30516 +#if __has_include() +#include +#endif /// Guard against including `signal.h` on WASI. The `signal.h` header file /// itself is available in wasi-libc, but it's just a stub that doesn't actually /// do anything. And also including it requires a special macro definition @@ -97,10 +103,6 @@ #include #endif -#if __has_include() -#include -#endif - #if __has_include() #include #endif