summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__threading_support
diff options
context:
space:
mode:
authorAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-14 13:56:58 +0000
committerAsiri Rathnayake <asiri.rathnayake@arm.com>2016-10-14 13:56:58 +0000
commit3cf2f7bca94995cf1343a6ad28a3abcd6ae7db8f (patch)
tree5887d8e31a7d6d8a06dcacafff824a69554113f4 /libcxx/include/__threading_support
parent53eab1efcf76940f1cd596081a024f78e9b04d6b (diff)
downloadbcm5719-llvm-3cf2f7bca94995cf1343a6ad28a3abcd6ae7db8f.tar.gz
bcm5719-llvm-3cf2f7bca94995cf1343a6ad28a3abcd6ae7db8f.zip
[libcxx] Improve the gcc workaround for the missing __has_include macro.
NFC. llvm-svn: 284237
Diffstat (limited to 'libcxx/include/__threading_support')
-rw-r--r--libcxx/include/__threading_support24
1 files changed, 11 insertions, 13 deletions
diff --git a/libcxx/include/__threading_support b/libcxx/include/__threading_support
index af3109efd46..36f1701f178 100644
--- a/libcxx/include/__threading_support
+++ b/libcxx/include/__threading_support
@@ -19,20 +19,18 @@
#ifndef _LIBCPP_HAS_NO_THREADS
-// These checks are carefully arranged so as not to trigger a gcc pre-processor
-// defect which causes it to fail to parse the __has_include check below, the
-// redundancy is intentional.
-#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)
-#if !defined(__clang__) && (_GNUC_VER < 500)
-#include <__external_threading>
-#define _LIBCPP_HAS_EXTERNAL_THREADING_HEADER
-#elif !defined(__has_include) || __has_include(<__external_threading>)
-#include <__external_threading>
-#define _LIBCPP_HAS_EXTERNAL_THREADING_HEADER
-#endif
+#ifndef __libcpp_has_include
+ #ifndef __has_include
+ #define __libcpp_has_include(x) 0
+ #else
+ #define __libcpp_has_include(x) __has_include(x)
+ #endif
#endif
-#if !defined(_LIBCPP_HAS_EXTERNAL_THREADING_HEADER)
+#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && \
+ __libcpp_has_include(<__external_threading>)
+#include <__external_threading>
+#else
#include <pthread.h>
#include <sched.h>
@@ -241,7 +239,7 @@ void __libcpp_tls_set(__libcpp_tls_key __key, void* __p)
_LIBCPP_END_NAMESPACE_STD
-#endif // !_LIBCPP_HAS_EXTERNAL_THREADING_HEADER
+#endif // !_LIBCPP_HAS_THREAD_API_EXTERNAL || !__libcpp_has_include(<__external_threading>)
#endif // _LIBCPP_HAS_NO_THREADS
OpenPOWER on IntegriCloud