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>
bb10
Thiago Macieira 2022-12-06 08:04:02 -08:00
parent 1558153360
commit 313720fef0
3 changed files with 8 additions and 10 deletions

View File

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

View File

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

View File

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