[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:
Chris Bieneman 2015-09-22 21:50:43 +00:00
parent 8bb31dd08a
commit 7908b12967
6 changed files with 24 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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