[libflac] Update libflac to 1.3.3 (#8988)

* [libflac] Update libflac to 1.3.3

* Update portfile.cmake
This commit is contained in:
Michał Janiszewski 2019-11-22 02:03:32 +01:00 committed by Robert Schumacher
parent 8c17d3c790
commit bfaf18478f
4 changed files with 62 additions and 68 deletions

View File

@ -1,5 +1,5 @@
Source: libflac Source: libflac
Version: 1.3.2-6 Version: 1.3.3
Homepage: https://xiph.org/flac/ Homepage: https://xiph.org/flac/
Description: Library for manipulating FLAC files Description: Library for manipulating FLAC files
Build-Depends: libogg Build-Depends: libogg

View File

@ -1,18 +1,10 @@
include(vcpkg_common_functions)
vcpkg_download_distfile(FLAC_MAX_MIN_PATCH
URLS "https://github.com/xiph/flac/commit/64f47c2d71ffba5aa8cd1d2a447339fd95f362f9.patch"
FILENAME "flac-max-min.patch"
SHA512 7ce9ccf9f081b478664cccd677c10269567672a8aa3a60839ef203b3d0a626d2b2c2f34d4c7fc897c31a436d7c22fb740bca5449a465dab39d60655417fe7772)
vcpkg_from_github( vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO xiph/flac REPO xiph/flac
REF 1.3.2 REF 1.3.3
SHA512 d0e177cadee371940516864bf72e1eb3d101a5f2779c854ecb8a3361a654a9b9e7efd303c83e2f308bacc7e54298d37705f677e2b955d4a9fe3470c364fa45f3 SHA512 4644dc8fd45e775d0e6210de2b082996692675307a7b7d359827730cc4cede9c2e1df46f4386023d83da9bafa6b3218d24012bf532f459087e311f14863747ec
HEAD_REF master HEAD_REF master
PATCHES PATCHES
"${FLAC_MAX_MIN_PATCH}"
"${CMAKE_CURRENT_LIST_DIR}/uwp-library-console.patch" "${CMAKE_CURRENT_LIST_DIR}/uwp-library-console.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch" "${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch"
) )

View File

@ -1,15 +1,15 @@
diff --git a/src/libFLAC/windows_unicode_filenames.c b/src/libFLAC/windows_unicode_filenames.c diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
index 2404e31..d320bf5 100644 index 8b20bbb7..058295fa 100644
--- a/src/libFLAC/windows_unicode_filenames.c --- a/src/share/win_utf8_io/win_utf8_io.c
+++ b/src/libFLAC/windows_unicode_filenames.c +++ b/src/share/win_utf8_io/win_utf8_io.c
@@ -185,6 +185,27 @@ int flac_internal_rename_utf8(const char *oldname, const char *newname) @@ -156,6 +156,27 @@ int get_utf8_argv(int *argc, char ***argv)
/* similar to CreateFileW but accepts UTF-8 encoded lpFileName */
HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) HANDLE WINAPI 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) +#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+ HANDLE handle = INVALID_HANDLE_VALUE; + HANDLE handle = INVALID_HANDLE_VALUE;
+ +
+ if (!utf8_filenames) + if (!flac_internal_get_utf8_filenames())
+ return handle; + return handle;
+ +
+ wchar_t *wname; + wchar_t *wname;
@ -27,12 +27,14 @@ index 2404e31..d320bf5 100644
+ +
+ return handle; + return handle;
+#else +#else
if (!utf8_filenames) { if (!flac_internal_get_utf8_filenames()) {
return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile); return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
} else { } else {
@@ -198,4 +219,5 @@ HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesi @@ -169,6 +190,7 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO
return handle; return handle;
} }
+#endif +#endif
} }
/* return number of characters in the UTF-8 string */

View File

@ -1,5 +1,5 @@
diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
index c61d27f..0870054 100644 index bbb6a74a..8b20bbb7 100644
--- a/src/share/win_utf8_io/win_utf8_io.c --- a/src/share/win_utf8_io/win_utf8_io.c
+++ b/src/share/win_utf8_io/win_utf8_io.c +++ b/src/share/win_utf8_io/win_utf8_io.c
@@ -110,7 +110,11 @@ int get_utf8_argv(int *argc, char ***argv) @@ -110,7 +110,11 @@ int get_utf8_argv(int *argc, char ***argv)
@ -9,12 +9,12 @@ index c61d27f..0870054 100644
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM) +#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
+ if ((handle = LoadPackagedLibrary("msvcrt.dll", 0)) == NULL) return 1; + if ((handle = LoadPackagedLibrary("msvcrt.dll", 0)) == NULL) return 1;
+#else +#else
if ((handle = LoadLibrary("msvcrt.dll")) == NULL) return 1; if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1;
+#endif +#endif
if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) { if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) {
FreeLibrary(handle); FreeLibrary(handle);
return 1; return 1;
@@ -163,6 +167,9 @@ size_t strlen_utf8(const char *str) @@ -181,6 +185,9 @@ size_t strlen_utf8(const char *str)
/* get the console width in characters */ /* get the console width in characters */
int win_get_console_width(void) int win_get_console_width(void)
{ {
@ -24,7 +24,7 @@ index c61d27f..0870054 100644
int width = 80; int width = 80;
CONSOLE_SCREEN_BUFFER_INFO csbi; CONSOLE_SCREEN_BUFFER_INFO csbi;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -170,6 +177,7 @@ int win_get_console_width(void) @@ -188,6 +195,7 @@ int win_get_console_width(void)
if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0) if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0)
width = csbi.dwSize.X; width = csbi.dwSize.X;
return width; return width;
@ -32,7 +32,7 @@ index c61d27f..0870054 100644
} }
/* print functions */ /* print functions */
@@ -179,6 +187,10 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len) @@ -197,6 +205,10 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
DWORD out; DWORD out;
int ret; int ret;
@ -43,7 +43,7 @@ index c61d27f..0870054 100644
do { do {
if (stream == stdout) { if (stream == stdout) {
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -197,6 +209,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len) @@ -215,6 +227,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
return out; return out;
} }
} while(0); } while(0);