summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-04 14:33:06 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-01-08 04:52:43 +0000
commitb096c53d593a313a6372bffb35f45cdc0e1ffd21 (patch)
tree31b9eb39439c6fb0055c167b1105489728ae6bbf /src/corelib/tools
parent78f234d5dd7face13dd88fd777fa27497590b34d (diff)
QtCore: Raise minimum supported MSVC version to 2015
Remove code for older versions and streamline #ifdefs. Task-number: QTBUG-51673 Change-Id: I211703189ff12f827d94914093369736b6e65d4a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qalgorithms.h2
-rw-r--r--src/corelib/tools/qbytearray.cpp4
-rw-r--r--src/corelib/tools/qbytearraymatcher.h5
-rw-r--r--src/corelib/tools/qchar.cpp2
-rw-r--r--src/corelib/tools/qdatetime.cpp4
-rw-r--r--src/corelib/tools/qhash.h2
-rw-r--r--src/corelib/tools/qstring.h2
-rw-r--r--src/corelib/tools/qstringview.cpp3
8 files changed, 8 insertions, 16 deletions
diff --git a/src/corelib/tools/qalgorithms.h b/src/corelib/tools/qalgorithms.h
index c0f7709fec..1a03bfaac4 100644
--- a/src/corelib/tools/qalgorithms.h
+++ b/src/corelib/tools/qalgorithms.h
@@ -42,7 +42,7 @@
#include <QtCore/qglobal.h>
-#if defined(Q_CC_MSVC) && _MSC_VER > 1500
+#ifdef Q_CC_MSVC
#include <intrin.h>
#endif
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 9b648adb06..adfa939cc6 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -268,7 +268,7 @@ char *qstrcpy(char *dst, const char *src)
{
if (!src)
return 0;
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#ifdef Q_CC_MSVC
const int len = int(strlen(src));
// This is actually not secure!!! It will be fixed
// properly in a later release!
@@ -304,7 +304,7 @@ char *qstrncpy(char *dst, const char *src, uint len)
if (!src || !dst)
return 0;
if (len > 0) {
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#ifdef Q_CC_MSVC
strncpy_s(dst, len, src, len - 1);
#else
strncpy(dst, src, len);
diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h
index c1c0c3a660..dafaea9c12 100644
--- a/src/corelib/tools/qbytearraymatcher.h
+++ b/src/corelib/tools/qbytearraymatcher.h
@@ -134,9 +134,6 @@ private:
}
};
-QT_WARNING_PUSH
-QT_WARNING_DISABLE_MSVC(4351) // MSVC 2013: "new behavior: elements of array ... will be default initialized"
- // remove once we drop MSVC 2013 support
template <uint N>
class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
{
@@ -158,8 +155,6 @@ public:
QByteArray pattern() const { return QByteArray(m_pattern, int(N - 1)); }
};
-QT_WARNING_POP
-
template <uint N>
Q_DECL_RELAXED_CONSTEXPR QStaticByteArrayMatcher<N> qMakeStaticByteArrayMatcher(const char (&pattern)[N]) Q_DECL_NOTHROW
{ return QStaticByteArrayMatcher<N>(pattern); }
diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp
index 31ea84a74e..94de69f075 100644
--- a/src/corelib/tools/qchar.cpp
+++ b/src/corelib/tools/qchar.cpp
@@ -624,8 +624,6 @@ QT_BEGIN_NAMESPACE
\since 5.10
Constructs a QChar corresponding to the UTF-16 character \a ch.
-
- \note This constructor is not available on MSVC 2013.
*/
/*!
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 050f37dcd2..fccf1c4afa 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2216,7 +2216,7 @@ static int qt_timezone()
static QString qt_tzname(QDateTimePrivate::DaylightStatus daylightStatus)
{
int isDst = (daylightStatus == QDateTimePrivate::DaylightTime) ? 1 : 0;
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#if defined(Q_CC_MSVC)
size_t s = 0;
char name[512];
if (_get_tzname(&s, name, 512, isDst))
@@ -2346,7 +2346,7 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
res = localtime_r(&secsSinceEpoch, &local);
if (res)
valid = true;
-#elif defined(_MSC_VER) && _MSC_VER >= 1400
+#elif defined(Q_CC_MSVC)
if (!_localtime64_s(&local, &secsSinceEpoch))
valid = true;
#else
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h
index e7ce4b658f..ce663ce2ca 100644
--- a/src/corelib/tools/qhash.h
+++ b/src/corelib/tools/qhash.h
@@ -969,7 +969,7 @@ Q_OUTOFLINE_TEMPLATE bool QHash<Key, T>::operator==(const QHash &other) const
//
// ### Qt 6: if C++14 library support is a mandated minimum, remove the ifdef for MSVC.
if (!std::is_permutation(it, thisEqualRangeEnd, otherEqualRange.first
-#if defined(Q_CC_MSVC) && _MSC_VER >= 1900
+#ifdef Q_CC_MSVC
, otherEqualRange.second
#endif
)) {
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index af1513442a..808f388c89 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1367,7 +1367,7 @@ inline std::wstring QString::toStdWString() const
std::wstring str;
str.resize(length());
-#if defined(_MSC_VER) && _MSC_VER >= 1400
+#ifdef Q_CC_MSVC
// VS2005 crashes if the string is empty
if (!length())
return str;
diff --git a/src/corelib/tools/qstringview.cpp b/src/corelib/tools/qstringview.cpp
index 9cefcd4531..0e3246c72c 100644
--- a/src/corelib/tools/qstringview.cpp
+++ b/src/corelib/tools/qstringview.cpp
@@ -371,8 +371,7 @@ QT_BEGIN_NAMESPACE
Returns a const pointer to the first character in the string.
- \c{storage_type} is \c{char16_t}, except on MSVC 2013 (which lacks \c char16_t support),
- where it is \c{wchar_t} instead.
+ \c{storage_type} is \c{char16_t}.
\note The character array represented by the return value is \e not null-terminated.