[vlc-commits] contrib: medialibrary: backport upstream fix for GetFullPathName usage

Steve Lhomme git at videolan.org
Wed Jun 3 14:36:14 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Wed May 27 12:44:03 2020 +0200| [5f36ffe439cce9af731ced02c8d6bae8878e5dc5] | committer: Steve Lhomme

contrib: medialibrary: backport upstream fix for GetFullPathName usage

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

 ...se-GetFullPathNameW-for-the-wide-char-API.patch | 26 ++++++++++++++++++++++
 contrib/src/medialibrary/rules.mak                 |  1 +
 2 files changed, 27 insertions(+)

diff --git a/contrib/src/medialibrary/0001-use-GetFullPathNameW-for-the-wide-char-API.patch b/contrib/src/medialibrary/0001-use-GetFullPathNameW-for-the-wide-char-API.patch
new file mode 100644
index 0000000000..e2222565c7
--- /dev/null
+++ b/contrib/src/medialibrary/0001-use-GetFullPathNameW-for-the-wide-char-API.patch
@@ -0,0 +1,26 @@
+From 2ac516186cd23213f7ef290c7aab9a16c7bdceba Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 3 Apr 2020 15:09:35 +0200
+Subject: [PATCH] use GetFullPathNameW for the wide char API
+
+Fixes the build with mingw64 in winrt mode.
+---
+ src/utils/Directory.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/utils/Directory.cpp b/src/utils/Directory.cpp
+index b34fab28..fdfd6e66 100644
+--- a/src/utils/Directory.cpp
++++ b/src/utils/Directory.cpp
+@@ -91,7 +91,7 @@ std::string toAbsolute( const std::string& path )
+ #else
+     wchar_t buff[MAX_PATH];
+     auto wpath = charset::ToWide( path.c_str() );
+-    if ( GetFullPathName( wpath.get(), MAX_PATH, buff, nullptr ) == 0 )
++    if ( GetFullPathNameW( wpath.get(), MAX_PATH, buff, nullptr ) == 0 )
+     {
+         LOG_ERROR( "Failed to convert ", path, " to absolute path" );
+         throw errors::System{ GetLastError(), "Failed to convert to absolute path" };
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/medialibrary/rules.mak b/contrib/src/medialibrary/rules.mak
index 0741385b76..dac169e946 100644
--- a/contrib/src/medialibrary/rules.mak
+++ b/contrib/src/medialibrary/rules.mak
@@ -21,6 +21,7 @@ medialibrary: medialibrary-$(MEDIALIBRARY_VERSION).tar.xz .sum-medialibrary
 	mkdir -p $@-$(MEDIALIBRARY_VERSION)
 	tar xvf "$<" --strip-components=1 -C $@-$(MEDIALIBRARY_VERSION)
 	$(APPLY) $(SRC)/medialibrary/0001-include-medialibrary-IDeviceLister.h-Include-string.patch
+	$(APPLY) $(SRC)/medialibrary/0001-use-GetFullPathNameW-for-the-wide-char-API.patch
 	$(call pkg_static, "medialibrary.pc.in")
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)



More information about the vlc-commits mailing list