mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-11-27 22:00:30 +00:00
[libcxx] Fix gcc builds.
Step around a gcc pre-processor defect which causes it to fail to parse the __has_include macro check. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@281310 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8b8913084d
commit
f6600b7524
@ -19,9 +19,20 @@
|
||||
|
||||
#ifndef _LIBCPP_HAS_NO_THREADS
|
||||
|
||||
#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && (!defined(__has_include) || __has_include(<__external_threading>))
|
||||
// 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>
|
||||
#else
|
||||
#define _LIBCPP_EXTERNAL_THREADING
|
||||
#elif !defined(__has_include) || __has_include(<__external_threading>)
|
||||
#include <__external_threading>
|
||||
#define _LIBCPP_EXTERNAL_THREADING
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(_LIBCPP_EXTERNAL_THREADING)
|
||||
#include <pthread.h>
|
||||
#include <sched.h>
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user