From: Kevin Ottens Date: Wed, 6 Jan 2021 16:07:50 +0000 (+0100) Subject: Fix CfAPI wrapper build in Win32 mode X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~21^2~437^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3b3864296a2bc09540989241325e938ed5a3275e;p=nextcloud-desktop.git Fix CfAPI wrapper build in Win32 mode For some reason MSVC manages to deduce the right constructor in Win64 mode but not in Win32 mode. So let's be more explicit about what we return. Signed-off-by: Kevin Ottens --- diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index 62ffcffa1..5fba7b724 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -346,13 +346,13 @@ OCC::CfApiWrapper::FileHandle OCC::CfApiWrapper::handleForPath(const QString &pa HANDLE handle = nullptr; const qint64 openResult = CfOpenFileWithOplock(path.toStdWString().data(), CF_OPEN_FILE_FLAG_NONE, &handle); if (openResult == S_OK) { - return {handle, CfCloseHandle}; + return FileHandle(handle, CfCloseHandle); } } else { const auto handle = CreateFile(path.toStdWString().data(), 0, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr); if (handle != INVALID_HANDLE_VALUE) { - return {handle, [](HANDLE h) { CloseHandle(h); }}; + return FileHandle(handle, [](HANDLE h) { CloseHandle(h); }); } }