From 4a8ea3e5b2e49d1a5604aa0c3586ae2fb9515d9c Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 26 Jan 2023 13:49:55 +0100 Subject: [PATCH] QtCore: Fix some macro clashes The macro decode() in qurlquery.cpp clashes with the static helper function decode() in qurlrecode.cpp. The macro encode() in qurlquery.cpp clashes with QStringEncoder::encode(). Macro CBOR_ENCODER_WRITER_CONTROL is defined with various values in 3rdparty/tinycbor and qcborstreamwriter.cpp. Task-number: QTBUG-109394 Change-Id: I8fdf696863e5b1e6fb0c5607b2dd5b46427b9104 Reviewed-by: Thiago Macieira (cherry picked from commit dc678299c8d38c11d1aa3f531e5d62dc2685bfa7) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/io/qurlquery.cpp | 4 ++++ src/corelib/serialization/qcborstreamwriter.cpp | 4 ++++ src/corelib/text/qbytearray.cpp | 3 +++ src/corelib/text/qbytearraymatcher.cpp | 2 ++ src/corelib/text/qstring.cpp | 3 +++ 5 files changed, 16 insertions(+) diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp index b8a9bc598e7..c707e8a2e64 100644 --- a/src/corelib/io/qurlquery.cpp +++ b/src/corelib/io/qurlquery.cpp @@ -817,3 +817,7 @@ void QUrlQuery::removeAllQueryItems(const QString &key) \sa operator==() */ QT_END_NAMESPACE + +#undef decode +#undef leave +#undef encode diff --git a/src/corelib/serialization/qcborstreamwriter.cpp b/src/corelib/serialization/qcborstreamwriter.cpp index 1842ed36fd0..0e00fe9bd69 100644 --- a/src/corelib/serialization/qcborstreamwriter.cpp +++ b/src/corelib/serialization/qcborstreamwriter.cpp @@ -829,3 +829,7 @@ bool QCborStreamWriter::endMap() } QT_END_NAMESPACE + +#undef CBOR_ENCODER_WRITER_CONTROL +#undef CBOR_ENCODER_WRITE_FUNCTION +#undef CBOR_ENCODER_NO_CHECK_USER diff --git a/src/corelib/text/qbytearray.cpp b/src/corelib/text/qbytearray.cpp index c92ab165645..736f6fb1927 100644 --- a/src/corelib/text/qbytearray.cpp +++ b/src/corelib/text/qbytearray.cpp @@ -5145,3 +5145,6 @@ size_t qHash(const QByteArray::FromBase64Result &key, size_t seed) noexcept */ QT_END_NAMESPACE + +#undef IS_RAW_DATA +#undef REHASH diff --git a/src/corelib/text/qbytearraymatcher.cpp b/src/corelib/text/qbytearraymatcher.cpp index 18f8c92c751..ae38fb584b8 100644 --- a/src/corelib/text/qbytearraymatcher.cpp +++ b/src/corelib/text/qbytearraymatcher.cpp @@ -411,3 +411,5 @@ qsizetype QStaticByteArrayMatcherBase::indexOfIn(const char *needle, size_t nlen QT_END_NAMESPACE + +#undef REHASH diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 271af2b8751..5f151ffbd67 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -11243,3 +11243,6 @@ void QAbstractConcatenable::appendLatin1To(QLatin1StringView in, QChar *out) noe */ QT_END_NAMESPACE + +#undef IS_RAW_DATA +#undef REHASH