aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hieta <tobias@plex.tv>2022-08-05 21:44:56 +0200
committerTobias Hieta <tobias@hieta.se>2022-08-05 21:45:23 +0200
commit4b8db17c32e04a1fe17440a6fb80aa96f31ff068 (patch)
tree20bbbd49e20f512575eeb7aea9826dfe1377671a
parent13bc71310920dced155328e25aa382dc2bb1ef9f (diff)
[llvm][macos] Fix usage of std::shared_mutex on old macOS SDK versions
When setting CMAKE_CXX_STANDARD to 17 and targeting a macOS version under 10.12 the ifdefs would try to use std::shared_mutex because the of the C++ standard. This should also check the targeted SDK. See discussion in: https://reviews.llvm.org/D130689 Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D131063
-rw-r--r--llvm/include/llvm/Support/RWMutex.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/RWMutex.h b/llvm/include/llvm/Support/RWMutex.h
index 3dd962586c36..a06a5c3e064f 100644
--- a/llvm/include/llvm/Support/RWMutex.h
+++ b/llvm/include/llvm/Support/RWMutex.h
@@ -94,15 +94,15 @@ private:
template <bool mt_only> class SmartRWMutex {
// shared_mutex (C++17) is more efficient than shared_timed_mutex (C++14)
// on Windows and always available on MSVC except with libc++.
+#if !defined(LLVM_USE_RW_MUTEX_IMPL)
#if (defined(_MSC_VER) && !defined(_LIBCPP_VERSION)) || __cplusplus > 201402L
std::shared_mutex impl;
#else
-#if !defined(LLVM_USE_RW_MUTEX_IMPL)
std::shared_timed_mutex impl;
+#endif
#else
RWMutexImpl impl;
#endif
-#endif
unsigned readers = 0;
unsigned writers = 0;