From 86c6804a41d2a879086b0b3b82d1189f41a082a0 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 26 Jan 2015 19:42:31 -0200 Subject: 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 --- src/corelib/global/qcompilerdetection.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/corelib/global') 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 # if defined(Q_OS_QNX) -# if defined(_YVALS) || defined(_LIBCPP_VER) -// QNX: libcpp (Dinkumware-based) doesn't have the -// 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__) \ -- cgit v1.2.3