[vlc-devel] [PATCH] contrib: harfbuzz: fix winstore build with older mingw toolchains

Steve Lhomme robux4 at ycbcr.xyz
Fri May 29 17:05:37 CEST 2020


In older mingw (before 60d5baaa7d1ec067b400910535655eefd4ba560b) GetFileSizeEx
was not allowed in winstore builds.
---
 ...rsal-Windows-builds-with-older-mingw.patch | 33 +++++++++++++++++++
 contrib/src/harfbuzz/rules.mak                |  1 +
 2 files changed, 34 insertions(+)
 create mode 100644 contrib/src/harfbuzz/0004-Fix-Universal-Windows-builds-with-older-mingw.patch

diff --git a/contrib/src/harfbuzz/0004-Fix-Universal-Windows-builds-with-older-mingw.patch b/contrib/src/harfbuzz/0004-Fix-Universal-Windows-builds-with-older-mingw.patch
new file mode 100644
index 000000000000..b0da9fd3e5ad
--- /dev/null
+++ b/contrib/src/harfbuzz/0004-Fix-Universal-Windows-builds-with-older-mingw.patch
@@ -0,0 +1,33 @@
+From e2c594a91294b4262f9571f732e1547368e5ccf8 Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Fri, 29 May 2020 13:48:31 +0200
+Subject: [PATCH 4/4] Fix Universal Windows builds with older mingw
+
+In older mingw (60d5baaa7d1ec067b400910535655eefd4ba560b) GetFileSizeEx was not
+allowed in winstore builds, but it is allowed [1].
+
+https://docs.microsoft.com/en-us/windows/win32/apiindex/windows-81-api-sets
+---
+ src/hb-blob.cc | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/hb-blob.cc b/src/hb-blob.cc
+index 609b87d8..2ed65d76 100644
+--- a/src/hb-blob.cc
++++ b/src/hb-blob.cc
+@@ -495,6 +495,12 @@ hb_blob_t::try_make_writable ()
+ 
+ #ifdef _WIN32
+ # include <windows.h>
++# if defined(__MINGW64_VERSION_MAJOR) && __MINGW64_VERSION_MAJOR < 8
++#  include <winapifamily.h>
++#  if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
++extern "C" DECLSPEC_IMPORT BOOL WINAPI GetFileSizeEx (HANDLE hFile, PLARGE_INTEGER lpFileSize);
++#  endif
++# endif
+ #else
+ # ifndef O_BINARY
+ #  define O_BINARY 0
+-- 
+2.26.0.windows.1
+
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index eb140ea4dd64..88feab243918 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -17,6 +17,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.xz .sum-harfbuzz
 	$(APPLY) $(SRC)/harfbuzz/0001-fix-OSAtomic-calls-for-AArch64.patch
 	$(APPLY) $(SRC)/harfbuzz/0002-Update-the-bundled-ax_pthread.m4.patch
 	$(APPLY) $(SRC)/harfbuzz/0003-Fix-winstore-app-detection-with-mingw64.patch
+	$(APPLY) $(SRC)/harfbuzz/0004-Fix-Universal-Windows-builds-with-older-mingw.patch
 	$(MOVE)
 
 DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
-- 
2.26.2



More information about the vlc-devel mailing list