From e4e74ba3520adeefc0a7e59b7834a23a0cf7eec1 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Fri, 31 Aug 2012 22:22:14 +0000 Subject: [PATCH] Properly enable Clang-style atomics when available. In addition to testing against cxx_atomic, we must check c_atomic. The former is only set when building C++ code. Also use __has_extension instead of __has_feature. This allows us to use the atomics outside of C11. Reported by: Ariane van der Steldt PR: threads/170073 --- include/stdatomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/stdatomic.h b/include/stdatomic.h index 35469e31456..b9f520432c1 100644 --- a/include/stdatomic.h +++ b/include/stdatomic.h @@ -33,7 +33,7 @@ #include #include -#if __has_feature(cxx_atomic) +#if __has_extension(c_atomic) || __has_extension(cxx_atomic) #define __CLANG_ATOMICS #elif __GNUC_PREREQ__(4, 7) #define __GNUC_ATOMICS