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
This commit is contained in:
Ed Schouten 2012-08-31 22:22:14 +00:00
parent 04b648fe23
commit e4e74ba352
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239960

View File

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