summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz.qnx@kdab.com>2012-07-03 10:28:55 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-03 14:41:56 +0200
commit9180d9aa8bfb9e9f66fad13f194398a98698eb77 (patch)
treeb834ecb8d896cdc21cd4b3ad10db87162fde9bd6
parentfcef238d3cd7ba99c15835788be1e90b3618bf25 (diff)
QNX: fix compilation with C++11 enabled
QNX uses GCC, but by default not libstdc++ as the standard library, but 'libcpp', a Dinkumware-derived implementation that doesn't sport many of the C++11 features, yet. Thus, the compiler detection sets Q_COMPILER_INITIALIZER_LIST, which is true, in a way, but we're lacking stdlib support, so the next \#include <initializer_list> will fail. So, simply don't define Q_COMPILER_INITIALIZER_LIST if we're on QNX and detect a Dinkumware signature (taken from Boost.Config). This is a hot-fix. I'm also preparing a more comprehensive solution (qstdlibdetection.h). Change-Id: Ieeb147251c2935517faba61f75d1580a9e1649c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/corelib/global/qcompilerdetection.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 6d8040a68f..5abf910254 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -661,6 +661,18 @@
//# define Q_COMPILER_INITIALIZER_LISTS
#endif
+#if defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX)
+# include <utility>
+# if defined(_YVALS) || defined(_LIBCPP_VER)
+// QNX: libcpp (Dinkumware-based) doesn't have the <initializer_list>
+// header, so the feature is useless, even if the compiler supports
+// it. Disable.
+# ifdef Q_COMPILER_INITIALIZER_LISTS
+# undef Q_COMPILER_INITIALIZER_LISTS
+# endif
+# endif
+#endif // Q_OS_BLACKBERRY || Q_OS_QNX
+
/*
* C++11 keywords and expressions
*/