[libcxx] r246168 - Do not include pthread.h and sched.h when threads are disabled

Jonathan Roelofs via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 27 10:47:35 PDT 2015


Author: jroelofs
Date: Thu Aug 27 12:47:34 2015
New Revision: 246168

URL: http://llvm.org/viewvc/llvm-project?rev=246168&view=rev
Log:
Do not include pthread.h and sched.h when threads are disabled

Patch by Philippe Daouadi!

http://reviews.llvm.org/D9639

Modified:
    libcxx/trunk/include/__mutex_base
    libcxx/trunk/include/mutex

Modified: libcxx/trunk/include/__mutex_base
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__mutex_base?rev=246168&r1=246167&r2=246168&view=diff
==============================================================================
--- libcxx/trunk/include/__mutex_base (original)
+++ libcxx/trunk/include/__mutex_base Thu Aug 27 12:47:34 2015
@@ -14,7 +14,9 @@
 #include <__config>
 #include <chrono>
 #include <system_error>
+#ifndef _LIBCPP_HAS_NO_THREADS
 #include <pthread.h>
+#endif
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
 #pragma GCC system_header

Modified: libcxx/trunk/include/mutex
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/mutex?rev=246168&r1=246167&r2=246168&view=diff
==============================================================================
--- libcxx/trunk/include/mutex (original)
+++ libcxx/trunk/include/mutex Thu Aug 27 12:47:34 2015
@@ -179,7 +179,9 @@ template<class Callable, class ...Args>
 #ifndef _LIBCPP_HAS_NO_VARIADICS
 #include <tuple>
 #endif
+#ifndef _LIBCPP_HAS_NO_THREADS
 #include <sched.h>
+#endif
 
 #include <__undef_min_max>
 




More information about the cfe-commits mailing list