From ad398b2df6a686791165661b0fd5b83c5a69a8cd Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 9 May 2023 16:21:08 +0200 Subject: [PATCH] QStyleSheetStyle: fix unity-build with chunk-size 13 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The definition of ceil() as a function-style preprocessor macro appears to clash with the definiton of QFixed::ceil(), included later. That's an educated guess, though, because the error is completely different: qstylesheetstyle.cpp:141:19: error: expected unqualified-id before ‘int’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ^~~ qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ^~~ qstylesheetstyle.cpp:141:19: error: expected ‘)’ before ‘int’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ~^~~ qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ^~~ qstylesheetstyle.cpp:141:19: error: expected ‘)’ before ‘int’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ~ ^~~ qstylesheetstyle.cpp:141:19: note: in definition of macro ‘ceil’ 141 | #define ceil(x) ((int)(x) + ((x) > 0 && (x) != (int)(x))) | ^~~ Fix by #undef'ing at the end of the TU. This is a minimal fix, suitable for backporting to older branches. A more modern fix will be forthcoming as a follow-up patch. Pick-to: 6.5 6.2 Change-Id: I8c1b6c7834e55b2bf28044a78ddf5bb544b23c65 Reviewed-by: Friedemann Kleint Reviewed-by: Amir Masoud Abdol Reviewed-by: Volker Hilsheimer --- src/widgets/styles/qstylesheetstyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 6ae6d18177..0b58044cc3 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -6490,6 +6490,8 @@ QPixmap QStyleSheetStyle::loadPixmap(const QString &fileName, const QObject *con return pixmap; } +#undef ceil + QT_END_NAMESPACE #include "moc_qstylesheetstyle_p.cpp"