From 313720fef09d321194fbd717fc04c14e793cd8b8 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 6 Dec 2022 08:04:02 -0800 Subject: [PATCH] qglobal.h: centralize the __ASSEMBLER__ check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We can declare that headers like qtnoop.h and qtypes.h are C or C++ headers, not assembler ones so we don't need to have them individually check that whether they're being compiled in assembler mode. This removes the accidental leak of the qt_noop() declaration into assembler and makes it clean: $ cpp -P -D__ASSEMBLER__ -Iinclude include/QtCore/qglobal.h | grep -c . 0 (using grep because it prints four empty lines) Change-Id: I69ecc04064514f939896fffd172e3fd6b6adc892 Reviewed-by: Øystein Heskestad Reviewed-by: Thiago Macieira --- src/corelib/global/qassert.h | 1 + src/corelib/global/qglobal.h | 13 +++++++------ src/corelib/global/qtypes.h | 4 ---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/corelib/global/qassert.h b/src/corelib/global/qassert.h index 28c6b6c8fc..a3cd60b06a 100644 --- a/src/corelib/global/qassert.h +++ b/src/corelib/global/qassert.h @@ -7,6 +7,7 @@ #include #include #include +#include #if 0 #pragma qt_class(QtAssert) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 3a9d40a068..1009057bad 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -27,20 +27,21 @@ #include -#include - #include #include #include -#include -#include -#include - +#ifndef __ASSEMBLER__ +# include +# include +# include +#endif /* !__ASSEMBLER__ */ #include #if defined(__cplusplus) +#include + // We need to keep QTypeInfo, QSysInfo, QFlags, qDebug & family in qglobal.h for compatibility with Qt 4. // Be careful when changing the order of these files. #include diff --git a/src/corelib/global/qtypes.h b/src/corelib/global/qtypes.h index f7757b4311..fa41f03c44 100644 --- a/src/corelib/global/qtypes.h +++ b/src/corelib/global/qtypes.h @@ -19,8 +19,6 @@ #pragma qt_sync_stop_processing #endif -#ifndef __ASSEMBLER__ - /* Useful type definitions for Qt */ @@ -158,6 +156,4 @@ using qsizetype = QIntegerForSizeof::Signed; QT_END_NAMESPACE -#endif // __ASSEMBLER__ - #endif // QTYPES_H