forked from OSchip/llvm-project
[builtins] Fixing atomic builtins to be compiled out if stdatomic.h isn't available.
This should fix the bots broken by r248322. Reviewed by bogner over my shoulder. llvm-svn: 248328
This commit is contained in:
parent
8bb31dd08a
commit
7908b12967
|
@ -12,8 +12,12 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_flag_clear
|
||||
void atomic_flag_clear(volatile atomic_flag *object) {
|
||||
return __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,9 +12,13 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_flag_clear_explicit
|
||||
void atomic_flag_clear_explicit(volatile atomic_flag *object,
|
||||
memory_order order) {
|
||||
return __c11_atomic_store(&(object)->_Value, 0, order);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,8 +12,12 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_flag_test_and_set
|
||||
_Bool atomic_flag_test_and_set(volatile atomic_flag *object) {
|
||||
return __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,9 +12,13 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_flag_test_and_set_explicit
|
||||
_Bool atomic_flag_test_and_set_explicit(volatile atomic_flag *object,
|
||||
memory_order order) {
|
||||
return __c11_atomic_exchange(&(object)->_Value, 1, order);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,8 +12,12 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_signal_fence
|
||||
void atomic_signal_fence(memory_order order) {
|
||||
__c11_atomic_signal_fence(order);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -12,8 +12,12 @@
|
|||
*===------------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#if __has_include(<stdatomic.h>)
|
||||
|
||||
#include <stdatomic.h>
|
||||
#undef atomic_thread_fence
|
||||
void atomic_thread_fence(memory_order order) {
|
||||
__c11_atomic_thread_fence(order);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue