summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-07-15 13:35:28 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-07-16 08:28:14 +0000
commitcf3a639f9d7f6325f3d0606b7f90cbc3c4450d96 (patch)
treebaf4dc8aa235375bc92ee5455442d13d3cc9309d
parent3aa5ef2ea92ccede193b89acc2ba7194a04df17d (diff)
Improve ICC compatibility with older MSVC versions (up to 2010)
Like on OS X and Linux, ICC uses the native compiler's standard library headers, so the C++11 features that depend on headers need special attention. * <initializer_list> is missing with MSVC 2012. It is present on 2010 for some reason and it appears to work * ICC disables Unicode string support prior to MSVC 2015, probably because MSVC Standard Library headers have a typedef for char16_t std::nullptr and std::move should have come with MSVC 2010, but I'm not keeping compatibility with MSVC 2008. It's been deprecated since ICC 14.0 (Composer XE 2013 SP1, released in 2013) and support was removed in 15.0 (Composer XE 2015, released in 2014). ICC hasn't supported MSVC 2005 since ICC 13.0 (Composer XE 2013). Task-number: QTBUG-47119 Change-Id: Ib306f8f647014b399b87ffff13f139174aeeafff Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
-rw-r--r--src/corelib/global/qcompilerdetection.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 48cef863c5..84afea0960 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -564,6 +564,16 @@
# endif
# define Q_COMPILER_UDL
# endif
+# ifdef _MSC_VER
+# if _MSC_VER == 1700
+// <initializer_list> is missing with MSVC 2012 (it's present in 2010, 2013 and up)
+# undef Q_COMPILER_INITIALIZER_LISTS
+# endif
+# if _MSC_VER < 1900
+// ICC disables unicode string support when compatibility mode with MSVC 2013 or lower is active
+# undef Q_COMPILER_UNICODE_STRINGS
+# endif
+# endif
# endif
#endif