summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2021-10-19 12:44:49 +0200
committerIvan Solovev <ivan.solovev@qt.io>2021-10-25 14:57:18 +0200
commit164e575673e47b2a3576e778840c027ccf0ae477 (patch)
treeb2cfc65fbe7aee95b94e249cf26e95c0ec0b17b0 /src/corelib
parent2a72f0f15d9c433d8d03873637e84fe2e10735b7 (diff)
Fix -trace build on Windows
The TraceLoggingValue template does not have overloads for Qt types, so it was throwing multiple template instantiation errors while trying to log the unknown types. Fix it by serializing such types to QString using QDebug::toString, and the logging this string. Apart from that, fixes some other compiler errors on Windows build with -trace enabled: - implicit size_t to ULONG conversion - complaints on std::min - add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE to the generated *_tracepoints_p.h headers to fix the namespace build. Task-number: QTBUG-97246 Fixes: QTBUG-97241 Pick-to: 6.2 Change-Id: Ifba134bab8d7fda7f1e30da9938e25cae813e1c6 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qlogging.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index fd38a9d6c4..e562fed336 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1682,7 +1682,7 @@ static void win_outputDebugString_helper(QStringView message)
} else {
wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1];
for (qsizetype i = 0; i < message.length(); i += maxOutputStringLength) {
- const qsizetype length = std::min(message.length() - i, maxOutputStringLength);
+ const qsizetype length = qMin(message.length() - i, maxOutputStringLength);
const qsizetype len = message.mid(i, length).toWCharArray(messagePart);
Q_ASSERT(len == length);
messagePart[len] = 0;