summaryrefslogtreecommitdiff
path: root/lib/builtins/atomic_flag_test_and_set_explicit.c
diff options
context:
space:
mode:
authorChris Bieneman <beanz@apple.com>2015-09-22 21:50:43 +0000
committerChris Bieneman <beanz@apple.com>2015-09-22 21:50:43 +0000
commit3c4ed73234869aff99528036c672cb06b7ec070d (patch)
tree35e2562de0d738ae0acd40da9344088b629abdcc /lib/builtins/atomic_flag_test_and_set_explicit.c
parent908ce765a9d8c0778c2e2986b90a1838b3422770 (diff)
[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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@248328 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/builtins/atomic_flag_test_and_set_explicit.c')
-rw-r--r--lib/builtins/atomic_flag_test_and_set_explicit.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/builtins/atomic_flag_test_and_set_explicit.c b/lib/builtins/atomic_flag_test_and_set_explicit.c
index eaa5be08d..cfc28cbde 100644
--- a/lib/builtins/atomic_flag_test_and_set_explicit.c
+++ b/lib/builtins/atomic_flag_test_and_set_explicit.c
@@ -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