From 3beb1f5dd8a69f925f29b4adf0cce94c252dff9f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 14 May 2024 06:44:59 +0200 Subject: [PATCH] qthreadstorage.h: fix position of namespace macros The file contains two implementations of the class template, one for QT_CONFIG(thread) and one for without. Both are in the QT_NAMESPACE, but each provided their own QT_{BEGIN,END}_NAMESPACE macro pair. This is unneeded and may throw off scripts which use the macros as insertion positions (like includemocs, which, however, operates on .cpp files, not headers). To fix, move the namespace macro pair to be around the #if QT_CONFIG(thread) block. Pick-to: 6.5 Change-Id: I56c1f9a4ef7df0fba54c72d8a213fa92573b826c Reviewed-by: Thiago Macieira (cherry picked from commit 8553ffd8d147ecf6a713d12a360027b477dd59c8) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit ee6982605410c62ca68f05f5666f8af069dc3e0e) --- src/corelib/thread/qthreadstorage.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/corelib/thread/qthreadstorage.h b/src/corelib/thread/qthreadstorage.h index 1a8dacae0fd..d81c8d85d89 100644 --- a/src/corelib/thread/qthreadstorage.h +++ b/src/corelib/thread/qthreadstorage.h @@ -6,10 +6,9 @@ #include -#if QT_CONFIG(thread) - QT_BEGIN_NAMESPACE +#if QT_CONFIG(thread) class Q_CORE_EXPORT QThreadStorageData { @@ -114,16 +113,12 @@ public: { qThreadStorage_setLocalData(d, &t); } }; -QT_END_NAMESPACE - #else // !QT_CONFIG(thread) #include #include -QT_BEGIN_NAMESPACE - template inline bool qThreadStorage_hasLocalData(const QScopedPointer &data) { @@ -193,8 +188,8 @@ public: } }; -QT_END_NAMESPACE - #endif // QT_CONFIG(thread) +QT_END_NAMESPACE + #endif // QTHREADSTORAGE_H