Enable C++11 atomics with Clang
I don't know why it was an #if 0. The __has_feature has been there for a while. But, just to be sure, we check the presence of the header too. Change-Id: I36e34c9e8fd4ce55c98966d2fad246b77eb16597 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
parent
1b961e8b5d
commit
1e9db9f5e1
@ -581,7 +581,7 @@
|
|||||||
# define Q_COMPILER_ALIGNAS
|
# define Q_COMPILER_ALIGNAS
|
||||||
# define Q_COMPILER_ALIGNOF
|
# define Q_COMPILER_ALIGNOF
|
||||||
# endif
|
# endif
|
||||||
# if 0 /* not implemented in clang yet */
|
# if __has_feature(cxx_atomic) && __has_include(<atomic>)
|
||||||
# define Q_COMPILER_ATOMICS
|
# define Q_COMPILER_ATOMICS
|
||||||
# endif
|
# endif
|
||||||
# if __has_feature(cxx_attributes)
|
# if __has_feature(cxx_attributes)
|
||||||
@ -880,6 +880,8 @@
|
|||||||
# undef Q_COMPILER_INITIALIZER_LISTS
|
# undef Q_COMPILER_INITIALIZER_LISTS
|
||||||
# undef Q_COMPILER_RVALUE_REFS
|
# undef Q_COMPILER_RVALUE_REFS
|
||||||
# undef Q_COMPILER_REF_QUALIFIERS
|
# undef Q_COMPILER_REF_QUALIFIERS
|
||||||
|
// Also disable <atomic>, since it's clearly not there
|
||||||
|
# undef Q_COMPILER_ATOMICS
|
||||||
# endif
|
# endif
|
||||||
# if defined(_LIBCPP_VERSION)
|
# if defined(_LIBCPP_VERSION)
|
||||||
// libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler
|
// libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler
|
||||||
|
Loading…
Reference in New Issue
Block a user