From 4c4afb6e8db325ef30f0fd45b6c19e18adfe8821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= Date: Mon, 28 Mar 2022 11:03:11 +0200 Subject: [PATCH] qfilesystemengine_win: Fix compilation with namespaces The original using is outside QT_NAMESPACE, so it is not correctly picked up by various parts of the code. Simply moving it inside QT_(BEGIN|END)_NAMESPACE revealed that the namespace (and thus scope) is closed and re-opened. in the file, so fix that too. Change-Id: I704f164b5705b539dbdf25b7743f5e339c016600 Reviewed-by: Sona Kurazyan --- src/corelib/io/qfilesystemengine_win.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 5d3681e58a..5dfb311fde 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -56,6 +56,7 @@ #if QT_CONFIG(regularexpression) #include "qregularexpression.h" #endif +#include "qstring.h" #include #include @@ -72,8 +73,6 @@ #define SECURITY_WIN32 #include -using namespace Qt::StringLiterals; - #ifndef SPI_GETPLATFORMTYPE #define SPI_GETPLATFORMTYPE 257 #endif @@ -153,9 +152,12 @@ static PSID currentUserSID = nullptr; static PSID currentGroupSID = nullptr; static PSID worldSID = nullptr; static HANDLE currentUserImpersonatedToken = nullptr; +#endif // fslibs QT_BEGIN_NAMESPACE +using namespace Qt::StringLiterals; +#if QT_CONFIG(fslibs) namespace { struct GlobalSid { @@ -415,12 +417,9 @@ constexpr QFileDevice::Permissions toSpecificPermissions(PermissionTag tag, return QFileDevice::Permissions::fromInt(permissions.toInt() << int(tag)); } -QT_END_NAMESPACE - } // anonymous namespace #endif // QT_CONFIG(fslibs) -QT_BEGIN_NAMESPACE Q_CORE_EXPORT int qt_ntfs_permission_lookup = 0;