summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2016-01-18 15:37:11 -0200
committerRafael Roquetto <rafael.roquetto@kdab.com>2016-01-22 18:06:39 +0000
commit684e5587d5024ff9523d76141d0befd1201dc24f (patch)
treeb62dca4b9d5e16b81a318ff02cc3108f9cf0d6e8 /src/corelib
parentdb2675d6fdb0d44fe1b040eda47f75e8bb35ce7a (diff)
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 <jmcdonnell@qnx.com> Reviewed-by: Dan Cape <dcape@qnx.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qcompilerdetection.h8
1 files changed, 4 insertions, 4 deletions
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