aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src/memory.cpp
diff options
context:
space:
mode:
authorNikolas Klauser <nikolasklauser@berlin.de>2024-11-06 10:39:19 +0100
committerGitHub <noreply@github.com>2024-11-06 10:39:19 +0100
commitc6f3b7bcd0596d30f8dabecdfb9e44f9a07b6e4c (patch)
treedbfd623fea1771448ff564d5fc4221db7fca2f84 /libcxx/src/memory.cpp
parent5acc4a3dc0e2145d2bfef47f1543bb291c2b866a (diff)
downloadllvm-c6f3b7bcd0596d30f8dabecdfb9e44f9a07b6e4c.zip
llvm-c6f3b7bcd0596d30f8dabecdfb9e44f9a07b6e4c.tar.gz
llvm-c6f3b7bcd0596d30f8dabecdfb9e44f9a07b6e4c.tar.bz2
[libc++] Refactor the configuration macros to being always defined (#112094)
This is a follow-up to #89178. This updates the `<__config_site>` macros.
Diffstat (limited to 'libcxx/src/memory.cpp')
-rw-r--r--libcxx/src/memory.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/src/memory.cpp b/libcxx/src/memory.cpp
index 7a1c283..16190c2 100644
--- a/libcxx/src/memory.cpp
+++ b/libcxx/src/memory.cpp
@@ -13,7 +13,7 @@
#include <memory>
-#ifndef _LIBCPP_HAS_NO_THREADS
+#if _LIBCPP_HAS_THREADS
# include <mutex>
# include <thread>
# if defined(__ELF__) && defined(_LIBCPP_LINK_PTHREAD_LIB)
@@ -96,7 +96,7 @@ __shared_weak_count* __shared_weak_count::lock() noexcept {
const void* __shared_weak_count::__get_deleter(const type_info&) const noexcept { return nullptr; }
-#if !defined(_LIBCPP_HAS_NO_THREADS)
+#if _LIBCPP_HAS_THREADS
static constexpr std::size_t __sp_mut_count = 32;
static constinit __libcpp_mutex_t mut_back[__sp_mut_count] = {
@@ -128,7 +128,7 @@ __sp_mut& __get_sp_mut(const void* p) {
return muts[hash<const void*>()(p) & (__sp_mut_count - 1)];
}
-#endif // !defined(_LIBCPP_HAS_NO_THREADS)
+#endif // _LIBCPP_HAS_THREADS
void* align(size_t alignment, size_t size, void*& ptr, size_t& space) {
void* r = nullptr;