diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2012-07-10 14:36:13 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-26 14:29:48 +0200 |
commit | bf186ceebb1801fb2af9b71182402bc80ebfc74a (patch) | |
tree | a7d2f61bf82bfd662f8ba64df3ce117a03c7e857 /src | |
parent | 3717802653049b794d5fbb006b8a671bd02e5896 (diff) |
qcompilerdetection.h: stream-line MSVC feature detection
Reformat the MSVC feature detection to be similar to other compilers, ie.
1. Inside the C++11 features section instead of where the compilers
are detected
2. In one block for the compiler, with sub-blocks for the version.
However, it's now not 100% compatible with the previous version,
since Q_CC_INTEL is now explicitly excluded while before it was
implicitly included in the MSVC case. I have no idea whether
that matters, since Q_CC_INTEL is handled for itself further up
already.
Change-Id: Id9e8da0a5394ad5643bcb29493f14bc6e8264c13
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 43f4439a29..2faa6bf066 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -106,10 +106,6 @@ # define Q_CC_INTEL # endif -# if defined(Q_CC_MSVC) && _MSC_VER >= 1400 -# define Q_COMPILER_VARIADIC_MACROS -# endif - /* only defined for MSVC since that's the only compiler that actually optimizes for this */ /* might get overridden further down when Q_COMPILER_NOEXCEPT is detected */ # define Q_DECL_NOTHROW throw() @@ -646,7 +642,13 @@ # endif #endif -#if defined(Q_CC_MSVC) && _MSC_VER >= 1600 && !defined(Q_CC_INTEL) +#if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL) +# if _MSC_VER >= 1400 + /* C++11 features supported in VC8 = VC2005: */ +# define Q_COMPILER_VARIADIC_MACROS +# endif +# if _MSC_VER >= 1600 + /* C++11 features supported in VC10 = VC2010: */ # define Q_COMPILER_AUTO_TYPE # define Q_COMPILER_LAMBDA # define Q_COMPILER_DECLTYPE @@ -654,7 +656,8 @@ # define Q_COMPILER_STATIC_ASSERT // MSVC has std::initilizer_list, but does not support the braces initialization //# define Q_COMPILER_INITIALIZER_LISTS -#endif +# endif +#endif /* Q_CC_MSVC */ #ifdef __cplusplus # if defined(Q_OS_BLACKBERRY) || defined(Q_OS_QNX) |