[flac-dev] [PATCH] move CreateFile() function from libFLAC

lvqcl lvqcl.mail at gmail.com
Sat Aug 18 09:20:42 UTC 2018


This patch renames flac_internal_CreateFile_utf8() function to
grabbag__CreateFile_utf8() and
moves it from /src/libFLAC/windows_unicode_filenames.c into
src/share/grabbag/file.c
This function is not used by libFLAC anyway.

After this, it should be possible to compile libFLAC as UWP.

In the old code there were 3 different #if  conditionals around the
code that uses CreateFile_utf8():
1)  #ifdef _WIN32 ... #endif
2)  #if defined _WIN32 && !defined __CYGWIN__ ... #endif
3)  #if defined _MSC_VER || defined __MINGW32__ ... #endif
It seems for me that the 2nd version makes more sense,so I replaced
them all with it.

Also this patch removes WINAPI_FAMILY_PARTITION ... CreateFile2 etc
stuff from the code.
The file src/share/grabbag/file.c contains non-UWP function
GetFileInformationByHandle,
and nobody complained, so it's OK to use non-UWP
CreateFileA/CreateFileW as well.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: move_function_CreateFile_out_of_libFLAC.patch
Type: application/octet-stream
Size: 8362 bytes
Desc: not available
URL: <http://lists.xiph.org/pipermail/flac-dev/attachments/20180818/60d6d22e/attachment.obj>


More information about the flac-dev mailing list