Skip to content

Commit

Permalink
qthreadstorage.h: fix position of namespace macros
Browse files Browse the repository at this point in the history
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.9 6.8 6.5
Change-Id: I56c1f9a4ef7df0fba54c72d8a213fa92573b826c
Reviewed-by: Thiago Macieira <[email protected]>
  • Loading branch information
marcmutz committed Dec 17, 2024
1 parent f6af3a5 commit 8553ffd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/corelib/thread/qthreadstorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@

#include <QtCore/qglobal.h>

#if QT_CONFIG(thread)

QT_BEGIN_NAMESPACE

#if QT_CONFIG(thread)

class Q_CORE_EXPORT QThreadStorageData
{
Expand Down Expand Up @@ -114,16 +113,12 @@ class QThreadStorage
{ qThreadStorage_setLocalData(d, &t); }
};

QT_END_NAMESPACE

#else // !QT_CONFIG(thread)

#include <QtCore/qscopedpointer.h>

#include <type_traits>

QT_BEGIN_NAMESPACE

template <typename T, typename U>
inline bool qThreadStorage_hasLocalData(const QScopedPointer<T, U> &data)
{
Expand Down Expand Up @@ -193,8 +188,8 @@ class QThreadStorage
}
};

QT_END_NAMESPACE

#endif // QT_CONFIG(thread)

QT_END_NAMESPACE

#endif // QTHREADSTORAGE_H

0 comments on commit 8553ffd

Please sign in to comment.