From 684e5587d5024ff9523d76141d0befd1201dc24f Mon Sep 17 00:00:00 2001 From: Rafael Roquetto Date: Mon, 18 Jan 2016 15:37:11 -0200 Subject: QNX: Fix -developer-build -developer-build enables -Werror=undef, which uncovered a bug inside qcompilerdetection.h. According to the Dinkum headers, it is necessary to account for three different states concerning the values of the _HAS_* macros: 1. undefined 2. 0 3. 1 Therefore, it is necessary to check both whether it is defined and if it is not 0. Only checking whether a given macro is 0 will generate a trap by -Werror=undef. (__GLIBCXX__ is the sole exception). Change-Id: Ib95e485698ee38858a1671d930d7e960b75bb041 Reviewed-by: James McDonnell Reviewed-by: Dan Cape Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index ba830977ad..b11237dce5 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -931,8 +931,8 @@ // 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 !__GLIBCXX__ -# if !_HAS_CPP0X +# if !defined(__GLIBCXX__) +# if !defined(_HAS_CPP0X) || !_HAS_CPP0X // Disable C++11 features that depend on library support # undef Q_COMPILER_INITIALIZER_LISTS # undef Q_COMPILER_RVALUE_REFS @@ -940,10 +940,10 @@ # undef Q_COMPILER_UNICODE_STRINGS # undef Q_COMPILER_NOEXCEPT # endif // !_HAS_CPP0X -# if !_HAS_NULLPTR_T +# if !defined(_HAS_NULLPTR_T) || !_HAS_NULLPTR_T # undef Q_COMPILER_NULLPTR # endif //!_HAS_NULLPTR_T -# if !_HAS_CONSTEXPR +# if !defined(_HAS_CONSTEXPR) || !_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 -- cgit v1.2.3