summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-12-17 14:50:45 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-01-30 01:29:12 +0000
commit77b33e4b856c8c60993c0d65ad32c146e98c6701 (patch)
tree1898141788a6dd409b44fb7c425fa64af9324f62 /src/corelib/global
parente0ecdebaa18b81dfe6690e688b7aa44b8b559c0c (diff)
Re-fix Clang-cl and ICC support on Windows
Instead of using the actual compiler version to determine which C++11 features to enable, let's just use the Mirosoft compiler version that the actual compiler is claiming compatibility with. That is because the limiting factor is often the standard library, not the compiler itself. This will cause some features that do not depend on the library to also be disabled, but oh well. Better upgrade your Visual Studio version instead. Task-number: QTBUG-57696 Change-Id: I3e4e5051937c40319d6efffd14912cd4fdab25fb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h34
1 files changed, 3 insertions, 31 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index c0f14e0f03..3b83d81f02 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -563,7 +563,7 @@
# endif
#endif
-#ifdef Q_CC_INTEL
+#if defined(Q_CC_INTEL) && !defined(Q_CC_MSVC)
# define Q_COMPILER_RESTRICTED_VLA
# define Q_COMPILER_VARIADIC_MACROS // C++11 feature supported as an extension in other modes, too
# define Q_COMPILER_THREADSAFE_STATICS
@@ -652,7 +652,7 @@
# endif
#endif
-#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL)
+#if defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) && !defined(Q_CC_MSVC)
/* General C++ features */
# define Q_COMPILER_RESTRICTED_VLA
# define Q_COMPILER_THREADSAFE_STATICS
@@ -898,7 +898,7 @@
# endif
#endif
-#if defined(Q_CC_MSVC) && !defined(Q_CC_INTEL)
+#if defined(Q_CC_MSVC)
# if defined(__cplusplus)
# if _MSC_VER >= 1400
/* C++11 features supported in VC8 = VC2005: */
@@ -1044,34 +1044,6 @@
# define __USE_CONSTEXPR 1
# define __USE_NOEXCEPT 1
# endif
-# if defined(Q_CC_MSVC) && defined(Q_CC_CLANG)
-// Clang and the Intel compiler support more C++ features than the Microsoft compiler
-// so make sure we don't enable them if the MS headers aren't properly adapted.
-# ifndef _HAS_CONSTEXPR
-# undef Q_COMPILER_CONSTEXPR
-# endif
-# ifndef _HAS_DECLTYPE
-# undef Q_COMPILER_DECLTYPE
-# endif
-# ifndef _HAS_INITIALIZER_LISTS
-# undef Q_COMPILER_INITIALIZER_LISTS
-# endif
-# ifndef _HAS_NULLPTR_T
-# undef Q_COMPILER_NULLPTR
-# endif
-# ifndef _HAS_RVALUE_REFERENCES
-# undef Q_COMPILER_RVALUE_REFS
-# endif
-# ifndef _HAS_SCOPED_ENUM
-# undef Q_COMPILER_CLASS_ENUM
-# endif
-# ifndef _HAS_TEMPLATE_ALIAS
-# undef Q_COMPILER_TEMPLATE_ALIAS
-# endif
-# ifndef _HAS_VARIADIC_TEMPLATES
-# undef Q_COMPILER_VARIADIC_TEMPLATES
-# endif
-# endif
# if defined(Q_COMPILER_THREADSAFE_STATICS) && defined(Q_OS_MAC)
// Apple's low-level implementation of the C++ support library
// (libc++abi.dylib, shared between libstdc++ and libc++) has deadlocks. The