Skip to content

Commit a73e924

Browse files
[libc] use LIBC_HAS_BUILTIN instead __has_builtin (#82377)
fix the issue that `__has_builtin` is undefined on some non-clang targets.
1 parent 96c5b8c commit a73e924

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/CPP/atomic.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ LIBC_INLINE void atomic_thread_fence([[maybe_unused]] MemoryOrder mem_ord) {
166166
// except no instructions for memory ordering are issued. Only reordering of
167167
// the instructions by the compiler is suppressed as order instructs.
168168
LIBC_INLINE void atomic_signal_fence([[maybe_unused]] MemoryOrder mem_ord) {
169-
#if __has_builtin(__atomic_signal_fence)
169+
#if LIBC_HAS_BUILTIN(__atomic_signal_fence)
170170
__atomic_signal_fence(static_cast<int>(mem_ord));
171171
#else
172172
// if the builtin is not ready, use asm as a full compiler barrier.

0 commit comments

Comments
 (0)