diff options
author | Marc Mutz <marc.mutz.qnx@kdab.com> | 2012-07-02 09:33:59 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-08 23:05:55 (GMT) |
commit | 3e679c01d2a83c2daeb2a655abc70913093b96c2 (patch) | |
tree | 8e5a5b943f631ed18a33a9eeffb497f62ca5801b | |
parent | 4148c9aa516a073ec4ea391f6ea577cb235025e5 (diff) | |
download | Qt-3e679c01d2a83c2daeb2a655abc70913093b96c2.zip Qt-3e679c01d2a83c2daeb2a655abc70913093b96c2.tar.gz Qt-3e679c01d2a83c2daeb2a655abc70913093b96c2.tar.bz2 |
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 correct, in a way, but since we're lacking stdlib support 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 back-port of change Ieeb147251c2935517faba61f75d1580a9e1649c4
from Qt 5.
Change-Id: Ic7cd11b19a01ae192f60aae33da5581ff8e4682c
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/global/qglobal.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 41f3a27..4e360fe 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -849,6 +849,18 @@ namespace QT_NAMESPACE {} # endif #endif +#if defined(Q_OS_QNX) || defined(Q_OS_BLACKBERRY) +# 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 + /* The window system, must be one of: (Q_WS_x) |