diff options
author | Eric Fiselier <eric@efcs.ca> | 2019-01-16 02:16:57 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2019-01-16 02:16:57 +0000 |
commit | efdac65f70e76d69f1b1956368316cb78227179c (patch) | |
tree | c688b18089a1d45aa5ea0e0c3e5ab49f058a6103 | |
parent | 05019eb79f9e15fc6e48acdd634c103239357824 (diff) |
Attempt to make test_macros.h even more minimal
llvm-svn: 351292
-rw-r--r-- | libcxx/test/support/test_macros.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 2813d1ff0685..e45253534174 100644 --- a/libcxx/test/support/test_macros.h +++ b/libcxx/test/support/test_macros.h @@ -11,7 +11,18 @@ #ifndef SUPPORT_TEST_MACROS_HPP #define SUPPORT_TEST_MACROS_HPP -#include <ciso646> // Get STL specific macros like _LIBCPP_VERSION +// Attempt to get STL specific macros like _LIBCPP_VERSION using the most +// minimal header possible. If we're testing libc++, we should use `<__config>`. +// If <__config> isn't available, fall back to <ciso646>. +#ifdef __has_include +# if __has_include("<__config>") +# include <__config> +# define TEST_IMP_INCLUDED_HEADER +# endif +#endif +#ifndef TEST_IMP_INCLUDED_HEADER +#include <ciso646> +#endif #if defined(__GNUC__) #pragma GCC diagnostic push |