aboutsummaryrefslogtreecommitdiff
path: root/lib/builtins/atomic_thread_fence.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/builtins/atomic_thread_fence.c')
-rw-r--r--lib/builtins/atomic_thread_fence.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/builtins/atomic_thread_fence.c b/lib/builtins/atomic_thread_fence.c
index 71f698c9de75..d22560151bc8 100644
--- a/lib/builtins/atomic_thread_fence.c
+++ b/lib/builtins/atomic_thread_fence.c
@@ -12,8 +12,16 @@
*===------------------------------------------------------------------------===
*/
+#ifndef __has_include
+#define __has_include(inc) 0
+#endif
+
+#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