summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/memory7
-rw-r--r--libcxx/src/memory.cpp4
2 files changed, 5 insertions, 6 deletions
diff --git a/libcxx/include/memory b/libcxx/include/memory
index 8324d1c5fe0..587d3059ebd 100644
--- a/libcxx/include/memory
+++ b/libcxx/include/memory
@@ -5464,9 +5464,8 @@ inline _LIBCPP_INLINE_VISIBILITY
basic_ostream<_CharT, _Traits>&
operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
-// TODO(EricWF): Enable this for both Clang and GCC. Currently it is only
-// enabled with clang.
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
class _LIBCPP_TYPE_VIS __sp_mut
{
@@ -5595,7 +5594,7 @@ atomic_compare_exchange_weak_explicit(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v
return atomic_compare_exchange_weak(__p, __v, __w);
}
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
//enum class
struct _LIBCPP_TYPE_VIS pointer_safety
diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp
index 08f2259b8c1..15e947fc0ff 100644
--- a/libcxx/src/memory.cpp
+++ b/libcxx/src/memory.cpp
@@ -124,7 +124,7 @@ __shared_weak_count::__get_deleter(const type_info&) const _NOEXCEPT
#endif // _LIBCPP_NO_RTTI
-#if defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#if !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
static const std::size_t __sp_mut_count = 16;
static __libcpp_mutex_t mut_back_imp[__sp_mut_count] =
@@ -177,7 +177,7 @@ __get_sp_mut(const void* p)
return muts[hash<const void*>()(p) & (__sp_mut_count-1)];
}
-#endif // defined(_LIBCPP_HAS_C_ATOMIC_IMP) && !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // !defined(_LIBCPP_HAS_NO_ATOMIC_HEADER)
void
declare_reachable(void*)
OpenPOWER on IntegriCloud