From b0a9b9ab87aedab65888f8d71f3a33da06ba9c7d Mon Sep 17 00:00:00 2001 From: James McDonnell Date: Wed, 7 Dec 2016 11:10:51 -0500 Subject: Adjust QNX choices Don't use Dinkum choices when the C++ library is libC++ (QNX 7.0). Change-Id: I18c3f716ccfb0c02dbfdc01eac4b707d3ae9aab6 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global/qcompilerdetection.h') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 4142c17b42..77ce488ca0 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -999,7 +999,7 @@ // Older versions (QNX 650) do not support C++11 features // _HAS_* macros are set to 1 by toolchains that actually include // Dinkum C++11 libcpp. -# if !defined(__GLIBCXX__) +# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION) # if !defined(_HAS_CPP0X) || !_HAS_CPP0X // Disable C++11 features that depend on library support # undef Q_COMPILER_INITIALIZER_LISTS -- cgit v1.2.3 From 858c1afb7af7d374520cbfb99aef8acadfaa9d88 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Tue, 10 Jan 2017 08:42:35 -0200 Subject: QNX: Fix comments on qcompilerdetection.h Change-Id: I75495b4ba3d8742419f824aa0e0b52694dbd42ed Reviewed-by: James McDonnell Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/corelib/global/qcompilerdetection.h') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 77ce488ca0..c0f14e0f03 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -995,11 +995,20 @@ #ifdef __cplusplus # include # if defined(Q_OS_QNX) -// QNX: test if we are using libcpp (Dinkumware-based). -// Older versions (QNX 650) do not support C++11 features +// By default, QNX 7.0 uses libc++ (from LLVM) and +// QNX 6.X uses Dinkumware's libcpp. In all versions, +// it is also possible to use GNU libstdc++. + +// For Dinkumware, some features must be disabled +// (mostly because of library problems). +// Dinkumware is assumed when __GLIBCXX__ (GNU libstdc++) +// and _LIBCPP_VERSION (LLVM libc++) are both absent. +# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION) + +// Older versions of libcpp (QNX 650) do not support C++11 features // _HAS_* macros are set to 1 by toolchains that actually include // Dinkum C++11 libcpp. -# if !defined(__GLIBCXX__) && !defined(_LIBCPP_VERSION) + # if !defined(_HAS_CPP0X) || !_HAS_CPP0X // Disable C++11 features that depend on library support # undef Q_COMPILER_INITIALIZER_LISTS @@ -1016,7 +1025,7 @@ // Disable constexpr support on QNX even if the compiler supports it # undef Q_COMPILER_CONSTEXPR # endif // !_HAS_CONSTEXPR -# endif // !__GLIBCXX__ +# endif // !__GLIBCXX__ && !_LIBCPP_VERSION # endif // Q_OS_QNX # if (defined(Q_CC_CLANG) || defined(Q_CC_INTEL)) && defined(Q_OS_MAC) && defined(__GNUC_LIBSTD__) \ && ((__GNUC_LIBSTD__-0) * 100 + __GNUC_LIBSTD_MINOR__-0 <= 402) -- cgit v1.2.3