diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-12-06 08:04:02 -0800 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-01-11 22:23:20 -0800 |
commit | 313720fef09d321194fbd717fc04c14e793cd8b8 (patch) | |
tree | 485e6b4aa0a90a70851f413fbdcc360dc5acb3ed | |
parent | 1558153360012bce03bc5899fb9b677c6fb30b55 (diff) |
qglobal.h: centralize the __ASSEMBLER__ check
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 <oystein.heskestad@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/global/qassert.h | 1 | ||||
-rw-r--r-- | src/corelib/global/qglobal.h | 13 | ||||
-rw-r--r-- | 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 <QtCore/qcompilerdetection.h> #include <QtCore/qtconfigmacros.h> #include <QtCore/qtcoreexports.h> +#include <QtCore/qtnoop.h> #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 <QtCore/qtpreprocessorsupport.h> -#include <QtCore/qtnoop.h> - #include <QtCore/qsystemdetection.h> #include <QtCore/qprocessordetection.h> #include <QtCore/qcompilerdetection.h> -#include <QtCore/qassert.h> -#include <QtCore/qtypes.h> -#include <QtCore/qtclasshelpermacros.h> - +#ifndef __ASSEMBLER__ +# include <QtCore/qassert.h> +# include <QtCore/qtnoop.h> +# include <QtCore/qtypes.h> +#endif /* !__ASSEMBLER__ */ #include <QtCore/qtversion.h> #if defined(__cplusplus) +#include <QtCore/qtclasshelpermacros.h> + // 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 <QtCore/qtypeinfo.h> 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<std::size_t>::Signed; QT_END_NAMESPACE -#endif // __ASSEMBLER__ - #endif // QTYPES_H |