Second attempt at fixing CfAPI wrapper build in Win32 mode
authorKevin Ottens <kevin.ottens@nextcloud.com>
Thu, 7 Jan 2021 12:41:51 +0000 (13:41 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Thu, 7 Jan 2021 12:49:10 +0000 (13:49 +0100)
commit2d8eb19ee5a9c4cc78b7d70a19855483466217db
tree8dde0675b0badf54f126fc5d05571ea5043bb5f6
parent79a54d68edb91e6e544f0ab6aae17917ada307e0
Second attempt at fixing CfAPI wrapper build in Win32 mode

MSVC having so useless error messages it didn't quite point to the root
cause of the issue... it turns out that through the maze of macros
defined in the windows API, there's one which impacted the function
pointer definition of CfCloseHandle which would then not convert to
FileHandle::Deleter as expected. So I end up wrapping it in a lambda to
help... luckily this kind of lambdas decay into a simple function
pointer so there's likely no overhead it's just to coerce the compiler
into doing the right thing.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
src/libsync/vfs/cfapi/cfapiwrapper.cpp