From 1f0dc7635ee5b004e15cdefc948fa4dc5d04bb23 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 12 Dec 2024 11:49:20 +0100 Subject: [PATCH] QLatin1StringView: put qstringfwd.h in control of Q_L1S_VIEW_IS_PRIMARY Less duplication, matches what we do for q_no_char8_t namespaces, too. Amends 94addad4dd1c89df9c6820d34b9a90424456c492. Pick-to: 6.8 6.5 Change-Id: I5d98babcb66d1196d3aed31c33289a1b11212a3d Reviewed-by: Ivan Solovev (cherry picked from commit 2d2ee569421338dbc07a479a7df2531bd37f0ebe) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/text/qlatin1stringview.h | 4 ++-- src/corelib/text/qstringfwd.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/text/qlatin1stringview.h b/src/corelib/text/qlatin1stringview.h index 73769df4cb6..31c36c63120 100644 --- a/src/corelib/text/qlatin1stringview.h +++ b/src/corelib/text/qlatin1stringview.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #if 0 @@ -24,8 +25,7 @@ QT_BEGIN_NAMESPACE class QString; -#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) || defined(Q_QDOC) -# define Q_L1S_VIEW_IS_PRIMARY +#ifdef Q_L1S_VIEW_IS_PRIMARY class QLatin1StringView #else class QLatin1String diff --git a/src/corelib/text/qstringfwd.h b/src/corelib/text/qstringfwd.h index 6d75201f7eb..374a8ff3cbe 100644 --- a/src/corelib/text/qstringfwd.h +++ b/src/corelib/text/qstringfwd.h @@ -28,6 +28,7 @@ QT_END_NO_CHAR8_T_NAMESPACE class QByteArray; class QByteArrayView; #if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED) || defined(Q_QDOC) +# define Q_L1S_VIEW_IS_PRIMARY class QLatin1StringView; using QLatin1String = QLatin1StringView; #else