[libcxx] r345173 - Fix use of libc++ specific macro in support/test_macros.h

Eric Fiselier eric at efcs.ca
Wed Oct 24 11:37:43 PDT 2018


Author: ericwf
Date: Wed Oct 24 11:37:42 2018
New Revision: 345173

URL: http://llvm.org/viewvc/llvm-project?rev=345173&view=rev
Log:
Fix use of libc++ specific macro in support/test_macros.h

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=345173&r1=345172&r2=345173&view=diff
==============================================================================
--- libcxx/trunk/test/support/test_macros.h (original)
+++ libcxx/trunk/test/support/test_macros.h Wed Oct 24 11:37:42 2018
@@ -87,8 +87,9 @@
 #endif
 #endif
 
-// Attempt to deduce GCC version
-#if defined(_LIBCPP_VERSION) && __has_include(<features.h>)
+// Attempt to deduce the GLIBC version
+#if (defined(__has_include) && __has_include(<features.h>)) || \
+    defined(__linux__)
 #include <features.h>
 #define TEST_HAS_GLIBC
 #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)
@@ -135,7 +136,7 @@
 #    define TEST_HAS_TIMESPEC_GET
 #  elif defined(__linux__)
 #    if !defined(_LIBCPP_HAS_MUSL_LIBC)
-#      if _LIBCPP_GLIBC_PREREQ(2, 17)
+#      if defined(TEST_GLIBC_PREREQ) && TEST_GLIBC_PREREQ(2, 17)
 #        define TEST_HAS_TIMESPEC_GET
 #        define TEST_HAS_C11_FEATURES
 #      endif




More information about the libcxx-commits mailing list