diff options
author | Schrodinger ZHU Yifan <yifanzhu@rochester.edu> | 2024-02-20 11:35:27 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 11:35:27 -0500 |
commit | a73e9244621a6186859644012c295740465ad844 (patch) | |
tree | 0dbf2c869557a0f2bbb44066b3504d3fe1674c92 /libc | |
parent | 96c5b8cbd19b172b257cb3401aeba666184f7a2a (diff) | |
download | llvm-a73e9244621a6186859644012c295740465ad844.zip llvm-a73e9244621a6186859644012c295740465ad844.tar.gz llvm-a73e9244621a6186859644012c295740465ad844.tar.bz2 |
[libc] use LIBC_HAS_BUILTIN instead __has_builtin (#82377)
fix the issue that `__has_builtin` is undefined on some non-clang
targets.
Diffstat (limited to 'libc')
-rw-r--r-- | libc/src/__support/CPP/atomic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/src/__support/CPP/atomic.h b/libc/src/__support/CPP/atomic.h index c10d06c..b74cb598 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. |