[libcxx] r259193 - [libcxx] Whitelist inclusion of sysctl.h instead of blacklisting
Ben Craig via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 29 05:53:23 PST 2016
Author: bcraig
Date: Fri Jan 29 07:53:23 2016
New Revision: 259193
URL: http://llvm.org/viewvc/llvm-project?rev=259193&view=rev
Log:
[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
Modified:
libcxx/trunk/src/thread.cpp
Modified: libcxx/trunk/src/thread.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/thread.cpp?rev=259193&r1=259192&r2=259193&view=diff
==============================================================================
--- libcxx/trunk/src/thread.cpp (original)
+++ libcxx/trunk/src/thread.cpp Fri Jan 29 07:53:23 2016
@@ -16,10 +16,15 @@
#include "future"
#include "limits"
#include <sys/types.h>
-#if !defined(_WIN32)
-# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) && !defined(__CloudABI__)
+
+#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
+# include <sys/param.h>
+# if defined(BSD)
# include <sys/sysctl.h>
-# 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 <unistd.h>
#endif // !_WIN32
More information about the cfe-commits
mailing list