[vlc-commits] contrib: flac: winrt: Remove a call to CreateFileA

Hugo Beauzée-Luyssen git at videolan.org
Thu Jan 5 17:18:10 CET 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Jan  5 17:12:21 2017 +0100| [bda86a1b65051b70404e733137665121bd787d32] | committer: Hugo Beauzée-Luyssen

contrib: flac: winrt: Remove a call to CreateFileA

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=bda86a1b65051b70404e733137665121bd787d32
---

 contrib/src/flac/no-createfilea.patch | 22 ++++++++++++++++++++++
 contrib/src/flac/rules.mak            |  1 +
 2 files changed, 23 insertions(+)

diff --git a/contrib/src/flac/no-createfilea.patch b/contrib/src/flac/no-createfilea.patch
new file mode 100644
index 0000000..4cefa2c
--- /dev/null
+++ b/contrib/src/flac/no-createfilea.patch
@@ -0,0 +1,22 @@
+--- flac/src/libFLAC/windows_unicode_filenames.c.orig	2017-01-05 16:36:45.696358168 +0100
++++ flac/src/libFLAC/windows_unicode_filenames.c	2017-01-05 17:03:41.052478210 +0100
+@@ -35,6 +35,7 @@
+ 
+ #include <io.h>
+ #include "share/windows_unicode_filenames.h"
++#include <winapifamily.h>
+ 
+ /* convert UTF-8 back to WCHAR. Caller is responsible for freeing memory */
+ static wchar_t *wchar_from_utf8(const char *str)
+@@ -186,7 +187,11 @@
+ HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
+ {
+ 	if (!utf8_filenames) {
++#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 
+ 		return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
++#else
++        return INVALID_HANDLE_VALUE;
++#endif
+ 	} else {
+ 		wchar_t *wname;
+ 		HANDLE handle = INVALID_HANDLE_VALUE;
diff --git a/contrib/src/flac/rules.mak b/contrib/src/flac/rules.mak
index 7367ccd..c48a609 100644
--- a/contrib/src/flac/rules.mak
+++ b/contrib/src/flac/rules.mak
@@ -18,6 +18,7 @@ flac: flac-$(FLAC_VERSION).tar.xz .sum-flac
 ifdef HAVE_WINSTORE
 	$(APPLY) $(SRC)/flac/console_write.patch
 	$(APPLY) $(SRC)/flac/remove_blocking_code_useless_flaclib.patch
+	$(APPLY) $(SRC)/flac/no-createfilea.patch
 endif
 ifdef HAVE_DARWIN_OS
 	cd $(UNPACK_DIR) && sed -e 's,-dynamiclib,-dynamiclib -arch $(ARCH),' -i.orig configure



More information about the vlc-commits mailing list