[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:34:14 PST 2024


================
@@ -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)
----------------
SchrodingerZhu wrote:

it seems that clang would not be happy with unknown function in `constexpr if`: https://godbolt.org/z/xeGevdqzW

https://github.com/llvm/llvm-project/pull/82377


More information about the libc-commits mailing list