[vlc-devel] [PATCH 2/2] contrib: medialibrary: backport upstream fix for GetFullPathName usage

Steve Lhomme robux4 at ycbcr.xyz
Sat May 30 08:39:12 CEST 2020


---
 ...tFullPathNameW-for-the-wide-char-API.patch | 26 +++++++++++++++++++
 contrib/src/medialibrary/rules.mak            |  1 +
 2 files changed, 27 insertions(+)
 create mode 100644 contrib/src/medialibrary/0001-use-GetFullPathNameW-for-the-wide-char-API.patch

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 000000000000..e2222565c7af
--- /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 0741385b763f..dac169e9463f 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)
-- 
2.26.2



More information about the vlc-devel mailing list