Allow libc++ to be built on systems without POSIX threads
If you're crazy enough to want this sort of thing, then add
-D_LIBCPP_HAS_NO_THREADS to your CXXFLAGS and
--param=additiona_features=libcpp-has-no-threads to your lit commnad line.
http://reviews.llvm.org/D3969
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@217271 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/memory b/include/memory
index dc9aeba..a9256da 100644
--- a/include/memory
+++ b/include/memory
@@ -610,7 +610,7 @@
#include <cassert>
#endif
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
# include <atomic>
#endif
@@ -5262,7 +5262,7 @@
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-#if __has_feature(cxx_atomic)
+#if __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
class _LIBCPP_TYPE_VIS __sp_mut
{
@@ -5388,7 +5388,7 @@
return atomic_compare_exchange_weak(__p, __v, __w);
}
-#endif // __has_feature(cxx_atomic)
+#endif // __has_feature(cxx_atomic) && !defined(_LIBCPP_HAS_NO_THREADS)
//enum class
struct _LIBCPP_TYPE_VIS pointer_safety