From b69650be3e2920acc75fc828124005ac376a4ce4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 9 Jan 2025 14:01:19 -0300 Subject: [PATCH] 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 (cherry picked from commit bec49144f809ef8c5c61099ce46241c16b20b180) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qcompilerdetection.h | 8 +++----- src/corelib/thread/qthreadstorage.h | 7 ------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 69cde64587d..137756aefc7 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -201,11 +201,9 @@ # define Q_DECL_PURE_FUNCTION __attribute__((pure)) # define Q_DECL_CONST_FUNCTION __attribute__((const)) # define Q_DECL_COLD_FUNCTION __attribute__((cold)) -# if !defined(QT_MOC_CPP) -# define Q_PACKED __attribute__ ((__packed__)) -# ifndef __ARM_EABI__ -# define QT_NO_ARM_EABI -# endif +# define Q_PACKED __attribute__ ((__packed__)) +# ifndef __ARM_EABI__ +# define QT_NO_ARM_EABI # endif # if Q_CC_GNU >= 403 && !defined(Q_CC_CLANG) # define Q_ALLOC_SIZE(x) __attribute__((alloc_size(x))) diff --git a/src/corelib/thread/qthreadstorage.h b/src/corelib/thread/qthreadstorage.h index 909203dc64b..35ba0700796 100644 --- a/src/corelib/thread/qthreadstorage.h +++ b/src/corelib/thread/qthreadstorage.h @@ -27,9 +27,6 @@ public: int id; }; -#if !defined(QT_MOC_CPP) -// MOC_SKIP_BEGIN - // pointer specialization template inline @@ -86,10 +83,6 @@ inline void qThreadStorage_deleteData(void *d, T *) { delete static_cast(d); } - -// MOC_SKIP_END -#endif - template class QThreadStorage {