summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 21:06:47 +0200
committerTarja Sundqvist <tarja.sundqvist@qt.io>2023-03-23 21:06:47 +0200
commit42e4ae042a4c86e58bcb8b6d2d59ba4a988285b4 (patch)
treea7f25b1d335a834a7c3ae104cee913ef3a4dd4fb /src/corelib/global
parent4ee4fc18b4067b90efa46ca9baba74f53b54d9ec (diff)
parent168ff3419f256fdb35b586275d293fc0cd773fe1 (diff)
Merge remote-tracking branch 'origin/tqtc/lts-5.15.9' into tqtc/lts-5.15-opensourcev5.15.9-lts-lgpl
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qcompilerdetection.h6
-rw-r--r--src/corelib/global/qlogging.cpp6
2 files changed, 9 insertions, 3 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 412fea96b4..03972594e7 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -1247,6 +1247,12 @@
#endif
/*
+ * "Weak overloads" - makes an otherwise confliciting overload weaker
+ * (by making it a template)
+ */
+#define Q_WEAK_OVERLOAD template <typename = void>
+
+/*
* Warning/diagnostic handling
*/
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index 89f49324c0..292116cc47 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1543,7 +1543,7 @@ static bool slog2_default_handler(QtMsgType type, const QMessageLogContext &cont
// Set as the default buffer
slog2_set_default_buffer(buffer_handle);
}
- int severity;
+ int severity = SLOG2_INFO;
//Determines the severity level
switch (type) {
case QtDebugMsg:
@@ -1669,7 +1669,7 @@ static bool android_default_message_handler(QtMsgType type,
#endif //Q_OS_ANDROID
#ifdef Q_OS_WIN
-static void win_outputDebugString_helper(QStringView message)
+static void win_outputDebugString_helper(const QString &message)
{
const int maxOutputStringLength = 32766;
static QBasicMutex m;
@@ -1681,7 +1681,7 @@ static void win_outputDebugString_helper(QStringView message)
wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1];
for (int i = 0; i < message.length(); i += maxOutputStringLength ) {
const int length = std::min(message.length() - i, maxOutputStringLength );
- const int len = message.mid(i, length).toWCharArray(messagePart);
+ const int len = QStringView{message}.mid(i, length).toWCharArray(messagePart);
Q_ASSERT(len == length);
messagePart[len] = 0;
OutputDebugString(messagePart);