summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorRafael Roquetto <rafael.roquetto@kdab.com>2015-10-28 14:56:16 -0200
committerRafael Roquetto <rafael.roquetto@kdab.com>2015-10-29 16:07:02 +0000
commitf7f4dde80e13ff1c05a9399297ffb746ab505e62 (patch)
tree58d84b8651de8e768a5543841e4e8e7821f6d846 /src/corelib/global
parent132b032a2f2220a60037e1fbc5273bbeee7763eb (diff)
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 <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h16
1 files 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)