diff options
author | ed <ed@FreeBSD.org> | 2012-08-31 22:22:14 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-08-31 22:22:14 +0000 |
commit | 114318f8e86988d471d9b26a8de4f93db13281d8 (patch) | |
tree | 996bf12e53bb6917a8e600cb890e4a08ed95c163 | |
parent | c689c7da4cc2b75006171643abcacf54855c3ae9 (diff) | |
download | FreeBSD-src-114318f8e86988d471d9b26a8de4f93db13281d8.zip FreeBSD-src-114318f8e86988d471d9b26a8de4f93db13281d8.tar.gz |
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 <ariane stack nl>
PR: threads/170073
-rw-r--r-- | include/stdatomic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stdatomic.h b/include/stdatomic.h index 35469e3..b9f5204 100644 --- a/include/stdatomic.h +++ b/include/stdatomic.h @@ -33,7 +33,7 @@ #include <sys/cdefs.h> #include <sys/_types.h> -#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 |