From cdd4a953171d1d4d897b3affd2fd944fcff37f68 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 2 May 2022 12:54:23 +0200 Subject: Use Q_CC_{GNU,MSVC}_ONLY when comparing to particular versions This prevents false-negatives and false-positives, as e.g. Clang 10.0.0 masks as GCC 4.2, so Q_CC_GNU is 402 on that compiler. Depending on the test (Q_CC_GNU > NNN or Q_CC_GNU < NNN), the result of the test is almost random. Q_CC__ONLY makes sure we match only GCC or MSVC, not bycatch such as Clang or ICC. Pick-to: 6.3 6.2 5.15 Change-Id: I4c550a11ecf85fc9a2216b330b69bd03d45b47e0 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Edward Welbourne Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot --- src/gui/text/qtexthtmlparser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/text/qtexthtmlparser.cpp b/src/gui/text/qtexthtmlparser.cpp index 7f5cde8fe3..aef5e34d7b 100644 --- a/src/gui/text/qtexthtmlparser.cpp +++ b/src/gui/text/qtexthtmlparser.cpp @@ -323,7 +323,7 @@ static const struct QTextHtmlEntity { const char name[9]; char16_t code; } entit }; static_assert(MAX_ENTITY == sizeof entities / sizeof *entities); -#if defined(Q_CC_MSVC) && _MSC_VER < 1600 +#if defined(Q_CC_MSVC_ONLY) && _MSC_VER < 1600 bool operator<(const QTextHtmlEntity &entity1, const QTextHtmlEntity &entity2) { return QLatin1StringView(entity1.name) < QLatin1StringView(entity2.name); -- cgit v1.2.3