summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2014-10-29 16:43:54 -0700
committerThiago Macieira <thiago.macieira@intel.com>2014-10-31 22:21:15 +0100
commit1e9db9f5e18123f2e686c10b39b586caf1307729 (patch)
tree57f00ae6754e45162ffe9a3540cc12d863f1ef8d
parent1b961e8b5d508d054e31c0050f27891606714393 (diff)
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>
-rw-r--r--src/corelib/global/qcompilerdetection.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index d7d5699591..949617fa7c 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -581,7 +581,7 @@
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# endif
-# if 0 /* not implemented in clang yet */
+# if __has_feature(cxx_atomic) && __has_include(<atomic>)
# define Q_COMPILER_ATOMICS
# endif
# if __has_feature(cxx_attributes)
@@ -880,6 +880,8 @@
# undef Q_COMPILER_INITIALIZER_LISTS
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
+// Also disable <atomic>, since it's clearly not there
+# undef Q_COMPILER_ATOMICS
# endif
# if defined(_LIBCPP_VERSION)
// libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler