[libcxx] r351292 - Attempt to make test_macros.h even more minimal
Eric Fiselier
eric at efcs.ca
Tue Jan 15 18:16:57 PST 2019
Author: ericwf
Date: Tue Jan 15 18:16:57 2019
New Revision: 351292
URL: http://llvm.org/viewvc/llvm-project?rev=351292&view=rev
Log:
Attempt to make test_macros.h even more minimal
Modified:
libcxx/trunk/test/support/test_macros.h
Modified: libcxx/trunk/test/support/test_macros.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/support/test_macros.h?rev=351292&r1=351291&r2=351292&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Tue Jan 15 18:16:57 2019
@@ -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
More information about the libcxx-commits
mailing list