diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2014-10-29 14:23:19 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2014-10-31 22:20:53 +0100 |
commit | 1b961e8b5d508d054e31c0050f27891606714393 (patch) | |
tree | 83daa75dd8610242637e8164df460386bc1043df | |
parent | a8df9982901a8e9d01cce06c9ffe2b34e6ea23a7 (diff) |
Fix compilation of <atomic> with ICC and libc++
The libc++ header does this:
#if !__has_feature(cxx_atomic)
#error <atomic> is not implemented
So we can't enable the feature until the compiler reports true for that
test.
Change-Id: I96f1c7eea8b93d93bd721fe5a85fa987339d091f
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 8e52c50322..d7d5699591 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -881,6 +881,13 @@ # undef Q_COMPILER_RVALUE_REFS # undef Q_COMPILER_REF_QUALIFIERS # endif +# if defined(_LIBCPP_VERSION) +// libc++ uses __has_feature(cxx_atomic), so disable the feature if the compiler +// doesn't support it. That's required for the Intel compiler on OS X, for example. +# if !__has_feature(cxx_atomic) +# undef Q_COMPILER_ATOMICS +# endif +# endif # if defined(Q_COMPILER_THREADSAFE_STATICS) && defined(Q_OS_MAC) // Mac OS X: Apple's low-level implementation of the C++ support library // (libc++abi.dylib, shared between libstdc++ and libc++) has deadlocks. The |