[libcxx-commits] [PATCH] D150421: [libc++][NFC] Use _LIBCPP_STD_VER instead of __cpp_lib_atomic_is_always_lock_free

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 13 16:27:19 PDT 2023


This revision was automatically updated to reflect the committed changes.
philnik marked an inline comment as done.
Closed by commit rGc04bcadf30ee: [libc++][NFC] Use _LIBCPP_STD_VER instead of… (authored by philnik).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D150421/new/

https://reviews.llvm.org/D150421

Files:
  libcxx/include/__atomic/aliases.h
  libcxx/include/__atomic/atomic_base.h


Index: libcxx/include/__atomic/atomic_base.h
===================================================================
--- libcxx/include/__atomic/atomic_base.h
+++ libcxx/include/__atomic/atomic_base.h
@@ -33,7 +33,7 @@
 {
     mutable __cxx_atomic_impl<_Tp> __a_;
 
-#if defined(__cpp_lib_atomic_is_always_lock_free)
+#if _LIBCPP_STD_VER >= 17
   static _LIBCPP_CONSTEXPR bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
 #endif
 
@@ -139,7 +139,7 @@
     __atomic_base(const __atomic_base&) = delete;
 };
 
-#if defined(__cpp_lib_atomic_is_always_lock_free)
+#if _LIBCPP_STD_VER >= 17
 template <class _Tp, bool __b>
 _LIBCPP_CONSTEXPR bool __atomic_base<_Tp, __b>::is_always_lock_free;
 #endif
Index: libcxx/include/__atomic/aliases.h
===================================================================
--- libcxx/include/__atomic/aliases.h
+++ libcxx/include/__atomic/aliases.h
@@ -82,7 +82,7 @@
 
 // atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type
 
-#ifdef __cpp_lib_atomic_is_always_lock_free
+#if _LIBCPP_STD_VER >= 17
 #  define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value
 #else
 #  define _LIBCPP_CONTENTION_LOCK_FREE false


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D150421.521955.patch
Type: text/x-patch
Size: 1268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230513/0614ea4f/attachment.bin>


More information about the libcxx-commits mailing list