summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto.qnx@kdab.com>2015-01-26 19:42:31 -0200
committerRafael Roquetto <rafael.roquetto@kdab.com>2015-02-12 10:09:37 +0000
commit86c6804a41d2a879086b0b3b82d1189f41a082a0 (patch)
tree21b815900173e1a7f9cea75c0b0831e56eb9c68f /src/corelib/global
parent317c341a66328f1ac4fdf302b009f8bb5002799d (diff)
QNX: fix compiler detection.
Short version: fix build on QNX 6.5.0. C++11 has been included on QNX 6.6.0's libcpp (Dinkum C++11 libs), while continuing to be unsupported by the older QNX 6.5.0 toolchain. This patch updates the mechanism for detecting the QNX's libcpp that is being used during compile time, and also updates the list of C++11 features to be disabled when QNX C++11 support is not present by adding Q_COMPILER_UNICODE_STRINGS and Q_COMPILER_NOEXCEPT to it. Change-Id: Iddb3626206a0d97d7103c1ff17ba0ae953e9a4b9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index d0d76ee52c..8ef8b79902 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -891,15 +891,17 @@
#ifdef __cplusplus
# include <utility>
# if defined(Q_OS_QNX)
-# if defined(_YVALS) || defined(_LIBCPP_VER)
-// QNX: libcpp (Dinkumware-based) doesn't have the <initializer_list>
-// header, so the feature is useless, even if the compiler supports
-// it. Disable.
+// QNX: test if we are using libcpp (Dinkumware-based).
+// Older versions (QNX 650) do not support C++11 features
+// _HAS_CPP0X is defined by toolchains that actually include
+// Dinkum C++11 libcpp.
+# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CPP0X)
+// Disable C++11 features that depend on library support
# undef Q_COMPILER_INITIALIZER_LISTS
-// That libcpp doesn't have std::move either, so disable everything
-// related to rvalue refs.
# undef Q_COMPILER_RVALUE_REFS
# undef Q_COMPILER_REF_QUALIFIERS
+# undef Q_COMPILER_UNICODE_STRINGS
+# undef Q_COMPILER_NOEXCEPT
# endif
# endif // Q_OS_QNX
# if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \