QThreadStorage: remove unused moc-skipping guards

QT_MOC_CPP is not the same as Q_MOC_RUN, which moc's preprocessor still
sets. It appears Qt 3's qmake set it when ALLMOC_HEADER was set... a
feature that doesn't appear in Qt 4 (but exists with cmake_automoc).

MOC_SKIP_{BEGIN,END} appears in Qt 3's moc, but not in Qt 4's. But they
weren't in qthreadstorage.h at the time, so I guess they were added in
the 4.0 development cycle when QThreadStorage changed, but before moc
was rewritten (which deleted the Qt historic repository's oldest file,
moc.l).

Change-Id: Ibfff778c9f4d17af006dfffd8545fb24b495ecdd
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit bec49144f809ef8c5c61099ce46241c16b20b180)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Thiago Macieira 2025-01-09 14:01:19 -03:00 committed by Qt Cherry-pick Bot
parent 2db67cb4b6
commit b69650be3e
2 changed files with 3 additions and 12 deletions

View File

@ -201,11 +201,9 @@
# define Q_DECL_PURE_FUNCTION __attribute__((pure)) # define Q_DECL_PURE_FUNCTION __attribute__((pure))
# define Q_DECL_CONST_FUNCTION __attribute__((const)) # define Q_DECL_CONST_FUNCTION __attribute__((const))
# define Q_DECL_COLD_FUNCTION __attribute__((cold)) # define Q_DECL_COLD_FUNCTION __attribute__((cold))
# if !defined(QT_MOC_CPP) # define Q_PACKED __attribute__ ((__packed__))
# define Q_PACKED __attribute__ ((__packed__)) # ifndef __ARM_EABI__
# ifndef __ARM_EABI__ # define QT_NO_ARM_EABI
# define QT_NO_ARM_EABI
# endif
# endif # endif
# if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG) # if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG)
# define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x))) # define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x)))

View File

@ -27,9 +27,6 @@ public:
int id; int id;
}; };
#if !defined(QT_MOC_CPP)
// MOC_SKIP_BEGIN
// pointer specialization // pointer specialization
template <typename T> template <typename T>
inline inline
@ -86,10 +83,6 @@ inline
void qThreadStorage_deleteData(void *d, T *) void qThreadStorage_deleteData(void *d, T *)
{ delete static_cast<T *>(d); } { delete static_cast<T *>(d); }
// MOC_SKIP_END
#endif
template <class T> template <class T>
class QThreadStorage class QThreadStorage
{ {