[PATCH] D49067: Stop wrapping __has_include in another macro

Alexander Richardson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 24 05:41:09 PDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL337824: Stop wrapping __has_include in another macro (authored by arichardson, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D49067

Files:
  libcxx/trunk/include/__config
  libcxx/trunk/test/support/test_macros.h


Index: libcxx/trunk/include/__config
===================================================================
--- libcxx/trunk/include/__config
+++ libcxx/trunk/include/__config
@@ -149,10 +149,8 @@
 
 #define __has_keyword(__x) !(__is_identifier(__x))
 
-#ifdef __has_include
-#  define __libcpp_has_include(__x) __has_include(__x)
-#else
-#  define __libcpp_has_include(__x) 0
+#ifndef __has_include
+#define __has_include(...) 0
 #endif
 
 #if defined(__clang__)
@@ -1066,7 +1064,7 @@
       defined(__APPLE__) || \
       defined(__CloudABI__) || \
       defined(__sun__) || \
-      (defined(__MINGW32__) && __libcpp_has_include(<pthread.h>))
+      (defined(__MINGW32__) && __has_include(<pthread.h>))
 #    define _LIBCPP_HAS_THREAD_API_PTHREAD
 #  elif defined(_LIBCPP_WIN32API)
 #    define _LIBCPP_HAS_THREAD_API_WIN32
Index: libcxx/trunk/test/support/test_macros.h
===================================================================
--- libcxx/trunk/test/support/test_macros.h
+++ libcxx/trunk/test/support/test_macros.h
@@ -27,10 +27,8 @@
 #define TEST_HAS_FEATURE(X) 0
 #endif
 
-#ifdef __has_include
-#define TEST_HAS_INCLUDE(X) __has_include(X)
-#else
-#define TEST_HAS_INCLUDE(X) 0
+#ifndef __has_include
+#define __has_include(...) 0
 #endif
 
 #ifdef __has_extension
@@ -90,7 +88,7 @@
 #endif
 
 // Attempt to deduce GCC version
-#if defined(_LIBCPP_VERSION) && TEST_HAS_INCLUDE(<features.h>)
+#if defined(_LIBCPP_VERSION) && __has_include(<features.h>)
 #include <features.h>
 #define TEST_HAS_GLIBC
 #define TEST_GLIBC_PREREQ(major, minor) __GLIBC_PREREQ(major, minor)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49067.157012.patch
Type: text/x-patch
Size: 1585 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180724/df256af6/attachment.bin>


More information about the cfe-commits mailing list