From 01fe12a053c29735af87f9ba78746bb0cdf79abd Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Wed, 16 Jan 2019 02:16:57 +0000 Subject: Attempt to make test_macros.h even more minimal --- libcxx/test/support/test_macros.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h index 2813d1ff068..e4525353417 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 // 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 . +#ifdef __has_include +# if __has_include("<__config>") +# include <__config> +# define TEST_IMP_INCLUDED_HEADER +# endif +#endif +#ifndef TEST_IMP_INCLUDED_HEADER +#include +#endif #if defined(__GNUC__) #pragma GCC diagnostic push -- cgit v1.2.3