Skip to content

Commit 5e84b5c

Browse files
committed
[CHERI] Update libc++ CHERI atomics workaround
This new include is needed after "[libc++] Granularize <atomic>".
1 parent 5abf7f8 commit 5e84b5c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libcxx/include/__atomic/is_always_lock_free.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ struct __libcpp_is_always_lock_free {
2525

2626
#ifdef __CHERI_PURE_CAPABILITY__
2727
// FIXME: can be removed after https://github.com/CTSRD-CHERI/llvm-project/pull/721 lands
28+
#include <__atomic/atomic_lock_free.h>
2829
template<typename _Tp> struct __libcpp_is_always_lock_free<_Tp*> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
29-
template<> struct __libcpp_is_always_lock_free<intptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
30-
template<> struct __libcpp_is_always_lock_free<uintptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
31-
template<> struct __libcpp_is_always_lock_free<std::nullptr_t> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
30+
template<> struct __libcpp_is_always_lock_free<__INTPTR_TYPE__> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
31+
template<> struct __libcpp_is_always_lock_free<__UINTPTR_TYPE__> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
32+
template<> struct __libcpp_is_always_lock_free<decltype(nullptr)> { enum { __value = 2 == ATOMIC_POINTER_LOCK_FREE }; };
3233
#endif
3334

3435
_LIBCPP_END_NAMESPACE_STD

0 commit comments

Comments
 (0)