From 93cfd7fc4e4e3b9b4ca18abdef49b395f8277e42 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Tue, 2 Dec 2014 17:30:19 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@223128 91177308-0d34-0410-b5e6-96231b3b80d8 --- src/thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/thread.cpp b/src/thread.cpp index 0ced1e3b..6aad558a 100644 --- a/src/thread.cpp +++ b/src/thread.cpp @@ -17,10 +17,10 @@ #include "limits" #include #if !defined(_WIN32) -#if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) -#include -#endif // !__sun__ && !__linux__ && !_AIX -#include +# if !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) +# include +# endif // !defined(__sun__) && !defined(__linux__) && !defined(_AIX) && !defined(__native_client__) +# include #endif // !_WIN32 #if defined(__NetBSD__)