From 7d9de89e75fe90fdc77a852d3cab23217be81bc5 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 18 Dec 2024 09:48:20 +0100 Subject: [PATCH] Protect QT_ENABLE_STRICT_MODE_UP_TO against predefined individual opt-outs [6.9] Since some of the Qt opt-outs are defined project-wide by the buildsystem these days (e.g. QT_NO_QSNPRINF, ...), a module that attempts to use QT_ENABLE_STRICT_MODE_UP_TO will hit warnings regarding re-definition of these macros (definition on the compiler command line, redefinition by qtconfigmacros.h). To fix, guard the #define QT_NO_FOO's with #ifndef QT_NO_FOO. Amends bd7d54249e3f2b6a9dd6b759c892d7c97d26c0aa (which was also picked to 6.8). Change-Id: I88276c9ed01edde1495105cf5bd1e07b1fd244f4 Reviewed-by: Ivan Solovev (cherry picked from commit 752de4a0aabc305af16251a55edf247e043b1b18) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit da9ff584d1475dcfc92e6f6323eef82b145d853a) --- src/corelib/global/qtconfigmacros.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/corelib/global/qtconfigmacros.h b/src/corelib/global/qtconfigmacros.h index 665ae9f5711..141932af63e 100644 --- a/src/corelib/global/qtconfigmacros.h +++ b/src/corelib/global/qtconfigmacros.h @@ -227,7 +227,9 @@ namespace QT_NAMESPACE {} #endif // 6.8.0 #if QT_ENABLE_STRICT_MODE_UP_TO >= QT_VERSION_CHECK(6, 9, 0) +# ifndef QT_NO_QSNPRINTF # define QT_NO_QSNPRINTF +# endif #endif // 6.9.0 #endif // QT_ENABLE_STRICT_MODE_UP_TO