From f7f4dde80e13ff1c05a9399297ffb746ab505e62 Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Wed, 28 Oct 2015 14:56:16 -0200 Subject: Fix C++11 compiler detection for QNX. 1. _HAS_DINKUM_CLIB is defined whenever a C header is included, even when Dinkum is disabled. 2. _HAS_* macros are always defined, as either 0 or 1. Change-Id: I727b854a6a733e2028e6facc327e264d0c4c9e90 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 8595c51368..2ff75d7561 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -922,24 +922,26 @@ # if defined(Q_OS_QNX) // 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 +// _HAS_* macros are set to 1 by toolchains that actually include // Dinkum C++11 libcpp. -# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CPP0X) +# if !__GLIBCXX__ +# if !_HAS_CPP0X // Disable C++11 features that depend on library support # undef Q_COMPILER_INITIALIZER_LISTS # undef Q_COMPILER_RVALUE_REFS # undef Q_COMPILER_REF_QUALIFIERS # undef Q_COMPILER_UNICODE_STRINGS # undef Q_COMPILER_NOEXCEPT -# endif -# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_NULLPTR_T) +# endif // !_HAS_CPP0X +# if !_HAS_NULLPTR_T # undef Q_COMPILER_NULLPTR -# endif -# if defined(_HAS_DINKUM_CLIB) && !defined(_HAS_CONSTEXPR) +# endif //!_HAS_NULLPTR_T +# if !_HAS_CONSTEXPR // The libcpp is missing constexpr keywords on important functions like std::numeric_limits<>::min() // Disable constexpr support on QNX even if the compiler supports it # undef Q_COMPILER_CONSTEXPR -# endif +# endif // !_HAS_CONSTEXPR +# endif // !__GLIBCXX__ # 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.1