From 904023e2deab93c1737460eacf4c2e68db699133 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 30 Jan 2025 19:33:41 -0800 Subject: [PATCH] Fix use of #warning in compilers that don't support them That becomes an error. So only allow them in GCC-compatible compilers. Fixes: QTBUG-133376 Change-Id: Idd04be795dd9fd2b43affffd08cd7b8a444bbc43 Reviewed-by: Ivan Solovev Reviewed-by: Alexey Edelev (cherry picked from commit 5da95322bd0ed7bfb94028582a82689124646dbd) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qtdeprecationdefinitions.h.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qtdeprecationdefinitions.h.in b/src/corelib/global/qtdeprecationdefinitions.h.in index 0570f63a5aa..93f884d07f1 100644 --- a/src/corelib/global/qtdeprecationdefinitions.h.in +++ b/src/corelib/global/qtdeprecationdefinitions.h.in @@ -4,6 +4,8 @@ #ifndef QTDEPRECATIONDEFINITIONS_H #define QTDEPRECATIONDEFINITIONS_H +#include + #ifndef QT_DISABLE_DEPRECATED_UP_TO # ifdef QT_DISABLE_DEPRECATED_BEFORE // If the deprecated macro is defined, use its value # define QT_DISABLE_DEPRECATED_UP_TO QT_DISABLE_DEPRECATED_BEFORE @@ -12,7 +14,7 @@ # endif #endif -#if QT_DISABLE_DEPRECATED_UP_TO < @QT_DISABLE_DEPRECATED_UP_TO@ +#if QT_DISABLE_DEPRECATED_UP_TO < @QT_DISABLE_DEPRECATED_UP_TO@ && defined(Q_CC_GNU) # warning QT_DISABLE_DEPRECATED_UP_TO is set to the version that is lower than the version that \ Qt was built with. This may lead to linking issues. #endif