From 7d00f97048a1681586cfdcd66307ebf86a4bb1ab Mon Sep 17 00:00:00 2001 From: Ben Craig Date: Fri, 29 Jan 2016 13:53:23 +0000 Subject: [PATCH] [libcxx] Whitelist inclusion of sysctl.h instead of blacklisting Instead of excluding all known operating systems that are not derived from BSD, I now include all operating systems that claim to be derived from BSD. Hopefully, that will make it so that this check doesn't need to change for every new operating system that comes along. http://reviews.llvm.org/D16634 llvm-svn: 259193 --- libcxx/src/thread.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index bd27f2878383..2243a34eb33a 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -16,10 +16,15 @@ #include "future" #include "limits" #include -#if !defined(_WIN32) -# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) && !defined(__CloudABI__) + +#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +# include +# if defined(BSD) # include -# endif // !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) && !defined(__CloudABI__) +# endif // defined(BSD) +#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) + +#if !defined(_WIN32) # include #endif // !_WIN32