QThreadStorage: move includes to the top
The qthreadstorage.h header contains two implementations controlled by the QT_CONFIG(thread) definition. Commit 8553ffd8d147ecf6a713d12a360027b477dd59c8 changed the positions of the namespace macros in the header, but didn't consider the fact that we now include std and Qt headers inside QT_NAMESPACE in the !QT_CONFIG(thread) case. Fix it by moving all the includes to the top, and wrapping them in the needed QT_CONFIG() checks. As a drive-by, drop the unused type_traits include. Found in Qt 6.9 API review, but picking down to 6.5, as that's what the original commit did. Note that 6.5 cherry-pick will require to replace <memory> with QtCore/qscopedpointer.h because 6da1f72311b844b2232da3067ad6e1e24614e67c was never picked to that branch. Pick-to: 6.5 Change-Id: Ic9c5fe82df38a3bd64829c016de8dcbd9f060315 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 4a6ef7fc6881c7b5ab0b9f6d51a2738ce86cca93) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit be31cbfce87294a6e59e472bd7efa96dfb7a40a4)
This commit is contained in:
parent
5fbe185931
commit
a699014fe5
@ -6,6 +6,10 @@
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if !QT_CONFIG(thread)
|
||||
#include <memory>
|
||||
#endif
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
#if QT_CONFIG(thread)
|
||||
@ -115,9 +119,6 @@ public:
|
||||
|
||||
#else // !QT_CONFIG(thread)
|
||||
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
template <typename T, typename U>
|
||||
inline bool qThreadStorage_hasLocalData(const std::unique_ptr<T, U> &data)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user