[libc-commits] [libc] [libc] use LIBC_HAS_BUILTIN instead __has_builtin (PR #82377)
Schrodinger ZHU Yifan via libc-commits
libc-commits at lists.llvm.org
Tue Feb 20 08:27:02 PST 2024
https://github.com/SchrodingerZhu created https://github.com/llvm/llvm-project/pull/82377
None
>From 609289f38567f1779f485419cce22a29b49a60f8 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <yifanzhu at rochester.edu>
Date: Tue, 20 Feb 2024 11:26:33 -0500
Subject: [PATCH] [libc] use LIBC_HAS_BUILTIN instead __has_builtin
---
libc/src/__support/CPP/atomic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/src/__support/CPP/atomic.h b/libc/src/__support/CPP/atomic.h
index c10d06c04bccad..b74cb5981dbaf8 100644
--- a/libc/src/__support/CPP/atomic.h
+++ b/libc/src/__support/CPP/atomic.h
@@ -166,7 +166,7 @@ LIBC_INLINE void atomic_thread_fence([[maybe_unused]] MemoryOrder mem_ord) {
// except no instructions for memory ordering are issued. Only reordering of
// the instructions by the compiler is suppressed as order instructs.
LIBC_INLINE void atomic_signal_fence([[maybe_unused]] MemoryOrder mem_ord) {
-#if __has_builtin(__atomic_signal_fence)
+#if LIBC_HAS_BUILTIN(__atomic_signal_fence)
__atomic_signal_fence(static_cast<int>(mem_ord));
#else
// if the builtin is not ready, use asm as a full compiler barrier.
More information about the libc-commits
mailing list