summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMårten Nordheim <marten.nordheim@qt.io>2023-11-09 13:11:35 +0100
committerMårten Nordheim <marten.nordheim@qt.io>2023-11-13 15:43:35 +0000
commit24ca6bd117648e28d8b966d97c0a76036cf57345 (patch)
tree20967ddbef4cbd5b82f77342b54f522c10c7cbc3
parentef2a6ba74f2ac176744ede6ab057162f54f0ace1 (diff)
Fix compilation with MSVC 17.8
stdext is deprecated, slated for removal. The macros were used to work around a compiler warning generated when using the 3-arg overload of certain STL algorithms even when the 4-arg version (added in C++14) was not available. These deprecation warnings seem to have been discontinued as of MSVC++ 14.15 _MSC_VER == 1915 (Visual Studio 2017 version 15.8) so making the macros no-ops from VS 2022 17.8 onward is not expected to trigger these warnings again. Pick-to: 6.5 6.2 5.15 Fixes: QTBUG-118993 Change-Id: I2c3b69d46d13f6fcccf0ffce186b984b7758f287 Reviewed-by: Marc Mutz <marc.mutz@qt.io> (cherry picked from commit 52b6258ec846cc53ebdb1c8167edd30db39c7891)
-rw-r--r--src/corelib/global/qcompilerdetection.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index a2c0b03597..8b6288c13d 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -76,8 +76,10 @@
# define Q_UNREACHABLE_IMPL() __assume(0)
# define Q_DECL_EXPORT __declspec(dllexport)
# define Q_DECL_IMPORT __declspec(dllimport)
-# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) stdext::make_unchecked_array_iterator(x) // Since _MSC_VER >= 1800
-# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
+# if _MSC_VER < 1938 // stdext is deprecated since VS 2022 17.8
+# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) stdext::make_unchecked_array_iterator(x) // Since _MSC_VER >= 1800
+# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
+# endif
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR