diff options
author | JF Bastien <jfb@google.com> | 2014-12-02 17:30:19 +0000 |
---|---|---|
committer | JF Bastien <jfb@google.com> | 2014-12-02 17:30:19 +0000 |
commit | b1ba015b9f9e4d2c4d2a5fe6ea8dc5580a391df1 (patch) | |
tree | 017add10b3f2ca5cabdac1cecb5f9edd80f0bd86 /libcxx/src | |
parent | 57f033a0245483312fb4eb4fcbb32403057d1f7f (diff) | |
download | bcm5719-llvm-b1ba015b9f9e4d2c4d2a5fe6ea8dc5580a391df1.tar.gz bcm5719-llvm-b1ba015b9f9e4d2c4d2a5fe6ea8dc5580a391df1.zip |
libc++: support NaCl when building thread.cpp
Summary: NaCl shouldn't include sysctl.h when trying to determine std::thread::hardware_concurrency, it should instead use sysconf(_SC_NPROCESSORS_ONLN) through unistd.h. No test needs to be changed, since hardware_concurrency.pass.cpp already tests that std::thread::hardware_concurrency > 0.
Test Plan: make check-libcxx
Reviewers: dschuff, danalbert
Subscribers: jfb, cfe-commits
Differential Revision: http://reviews.llvm.org/D6470
llvm-svn: 223128
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/thread.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index 0ced1e3bba1..6aad558abaa 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -17,10 +17,10 @@ #include "limits" #include <sys/types.h> #if !defined(_WIN32) -#if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) -#include <sys/sysctl.h> -#endif // !__sun__ && !__linux__ && !_AIX -#include <unistd.h> +# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) +# include <sys/sysctl.h> +# endif // !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) +# include <unistd.h> #endif // !_WIN32 #if defined(__NetBSD__) |