QStyleSheetStyle: fix unity-build with chunk-size 13

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 <Friedemann.Kleint@qt.io>
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2023-05-09 16:21:08 +02:00
parent 3efefcceba
commit ad398b2df6

View File

@ -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"