From: JF Bastien Date: Tue, 2 Dec 2014 17:30:19 +0000 (+0000) Subject: libc++: support NaCl when building thread.cpp X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b1ba015b9f9e4d2c4d2a5fe6ea8dc5580a391df1;p=platform%2Fupstream%2Fllvm.git 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 --- diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index 0ced1e3..6aad558 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/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__)