diff options
| author | Alexander Karatarakis <alex@karatarakis.com> | 2017-11-21 01:03:35 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-21 01:03:35 -0800 |
| commit | 9d93342017a8c06d87c6c90341d6261ccefe2e46 (patch) | |
| tree | 60bde4e73361fee4c51430a7d53714e0ce0d3980 /ports/libflac/uwp-createfile2.patch | |
| parent | 7604a246daab900b7472828fdac32f021c1b1ae3 (diff) | |
| parent | 38ae2f69b7f376614f6a4b9201a23fcaa228baf9 (diff) | |
| download | vcpkg-9d93342017a8c06d87c6c90341d6261ccefe2e46.tar.gz vcpkg-9d93342017a8c06d87c6c90341d6261ccefe2e46.zip | |
Merge pull request #2214 from aybe/libflac-uwp
[libflac] patches for UWP builds
Diffstat (limited to 'ports/libflac/uwp-createfile2.patch')
| -rw-r--r-- | ports/libflac/uwp-createfile2.patch | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ports/libflac/uwp-createfile2.patch b/ports/libflac/uwp-createfile2.patch new file mode 100644 index 000000000..cfb343990 --- /dev/null +++ b/ports/libflac/uwp-createfile2.patch @@ -0,0 +1,38 @@ +diff --git a/src/libFLAC/windows_unicode_filenames.c b/src/libFLAC/windows_unicode_filenames.c +index 2404e31..d320bf5 100644 +--- a/src/libFLAC/windows_unicode_filenames.c ++++ b/src/libFLAC/windows_unicode_filenames.c +@@ -185,6 +185,27 @@ int flac_internal_rename_utf8(const char *oldname, const char *newname) + + HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) + { ++#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) ++ HANDLE handle = INVALID_HANDLE_VALUE; ++ ++ if (!utf8_filenames) ++ return handle; ++ ++ wchar_t *wname; ++ ++ if ((wname = wchar_from_utf8(lpFileName)) != NULL) ++ { ++ CREATEFILE2_EXTENDED_PARAMETERS cfParams = {0}; ++ cfParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS); ++ cfParams.dwFileAttributes = dwFlagsAndAttributes & FILE_ATTRIBUTE_NORMAL; ++ cfParams.lpSecurityAttributes = lpSecurityAttributes; ++ cfParams.hTemplateFile = hTemplateFile; ++ handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, dwCreationDisposition, &cfParams); ++ free(wname); ++ } ++ ++ return handle; ++#else + if (!utf8_filenames) { + return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); + } else { +@@ -198,4 +219,5 @@ HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesi + + return handle; + } ++#endif + } |
