libc++: support NaCl when building thread.cpp

Summary: NaCl shouldn't include sysctl.h when trying to determine std:🧵: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:🧵:hardware_concurrency > 0.

Test Plan: make check-libcxx

Reviewers: dschuff, danalbert

Subscribers: jfb, cfe-commits

Differential Revision: http://reviews.llvm.org/D6470

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223128 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
JF Bastien 2014-12-02 17:30:19 +00:00
parent 2bd5ffd330
commit 93cfd7fc4e

View File

@ -17,9 +17,9 @@
#include "limits"
#include <sys/types.h>
#if !defined(_WIN32)
#if !defined(__sun__) && !defined(__linux__) && !defined(_AIX)
# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__)
# include <sys/sysctl.h>
#endif // !__sun__ && !__linux__ && !_AIX
# endif // !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__)
# include <unistd.h>
#endif // !_WIN32