Skip to content
Snippets Groups Projects
Commit 233747ab authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf Committed by François Cartegnie
Browse files

Contribs: update harfbuzz to 2.7.4

parent 69b61afb
No related branches found
No related tags found
1 merge request!359Contribs: update harfbuzz to 2.7.4
Pipeline #114561 passed with stages
in 23 minutes and 40 seconds
From 6b1c0cb9a88424f4d1af769067acf1f6fea66ece Mon Sep 17 00:00:00 2001
From: Steve Lhomme <robux4@ycbcr.xyz>
Date: Fri, 3 Apr 2020 13:05:14 +0200
Subject: [PATCH 3/3] Fix winstore app detection with mingw64
mingw64 doesn't have WINAPI_FAMILY_PC_APP and WINAPI_FAMILY_PHONE_APP but the
same detection can be achieved by testing WINAPI_PARTITION_DESKTOP.
---
src/hb-blob.cc | 6 +++---
src/hb-mutex.hh | 2 +-
src/hb.hh | 5 +++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/hb-blob.cc b/src/hb-blob.cc
index 2e72683c..609b87d8 100644
--- a/src/hb-blob.cc
+++ b/src/hb-blob.cc
@@ -581,7 +581,7 @@ fail_without_close:
wchar_t * wchar_file_name = (wchar_t *) malloc (sizeof (wchar_t) * size);
if (unlikely (wchar_file_name == nullptr)) goto fail_without_close;
mbstowcs (wchar_file_name, file_name, size);
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
{
CREATEFILE2_EXTENDED_PARAMETERS ceparams = { 0 };
ceparams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
@@ -602,7 +602,7 @@ fail_without_close:
if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close;
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
{
LARGE_INTEGER length;
GetFileSizeEx (fd, &length);
@@ -615,7 +615,7 @@ fail_without_close:
#endif
if (unlikely (file->mapping == nullptr)) goto fail;
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
file->contents = (char *) MapViewOfFileFromApp (file->mapping, FILE_MAP_READ, 0, 0);
#else
file->contents = (char *) MapViewOfFile (file->mapping, FILE_MAP_READ, 0, 0, 0);
diff --git a/src/hb-mutex.hh b/src/hb-mutex.hh
index e7f8b1c4..f48d6b29 100644
--- a/src/hb-mutex.hh
+++ b/src/hb-mutex.hh
@@ -64,7 +64,7 @@ typedef pthread_mutex_t hb_mutex_impl_t;
#include <windows.h>
typedef CRITICAL_SECTION hb_mutex_impl_t;
#define HB_MUTEX_IMPL_INIT {0}
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
#define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0)
#else
#define hb_mutex_impl_init(M) InitializeCriticalSection (M)
diff --git a/src/hb.hh b/src/hb.hh
index fcbd3305..492b9848 100644
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -334,8 +334,9 @@ extern "C" void hb_free_impl(void *ptr);
# if defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0600
# undef _WIN32_WINNT
# endif
+# include <winapifamily.h>
# ifndef _WIN32_WINNT
-# if !defined(WINAPI_FAMILY) || !(WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# define _WIN32_WINNT 0x0600
# endif
# endif
@@ -356,7 +357,7 @@ extern "C" void hb_free_impl(void *ptr);
# define HB_NO_SETLOCALE
# define HB_NO_ERRNO
# endif
-# elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
+# elif !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
# ifndef HB_NO_GETENV
# define HB_NO_GETENV
# endif
--
2.26.0.windows.1
From 130296d079a65b26b15acb9d0a69ef9497fad701 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Wed, 2 Jun 2021 09:49:24 +0300
Subject: [PATCH 4/4] Don't treat -Wunused as an error
This is a fragile warning - newer compilers can add warnings to cases
that weren't there before.
Clang 13 got support for the -Wunused-but-set-variable warning, which
gets enabled implicitly via -Wunused, and it warns on one variable
like this:
hb-subset-cff1.cc:405:33: error: variable 'supp_size' set but not used [-Werror,
-Wunused-but-set-variable]
unsigned int size0, size1, supp_size;
^
---
src/hb.hh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hb.hh b/src/hb.hh
index e46aa0b6e..b0beaaa81 100644
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -86,10 +86,8 @@
#pragma GCC diagnostic error "-Wswitch-enum"
#pragma GCC diagnostic error "-Wtautological-overlap-compare"
#pragma GCC diagnostic error "-Wunneeded-internal-declaration"
-#pragma GCC diagnostic error "-Wunused"
#pragma GCC diagnostic error "-Wunused-local-typedefs"
#pragma GCC diagnostic error "-Wunused-value"
-#pragma GCC diagnostic error "-Wunused-variable"
#pragma GCC diagnostic error "-Wvla"
#pragma GCC diagnostic error "-Wwrite-strings"
#endif
@@ -107,6 +105,8 @@
#pragma GCC diagnostic warning "-Wmaybe-uninitialized"
#pragma GCC diagnostic warning "-Wmissing-format-attribute"
#pragma GCC diagnostic warning "-Wundef"
+#pragma GCC diagnostic warning "-Wunused"
+#pragma GCC diagnostic warning "-Wunused-variable"
#endif
/* Ignored currently, but should be fixed at some point. */
--
2.25.1
651b23d7d4fab6fef472ee57db39bbaebc31c2f40ea3a482c1499ad1a7b549b86a2bccbe9da191c8e9ecdf464191dd3c9a7485546b51695ad8ab3c0329732d9d harfbuzz-2.6.8.tar.xz
d2af6a768c397c664f654cf36140e7b5696b3b983f637454604570c348247f7ffea135048d9b02cf6593cbde728567e31bf82a39df5ff38d680c78dff24d4cf0 harfbuzz-2.7.4.tar.xz
# HARFBUZZ
HARFBUZZ_VERSION := 2.6.8
HARFBUZZ_VERSION := 2.7.4
HARFBUZZ_URL := https://github.com/harfbuzz/harfbuzz/releases/download/$(HARFBUZZ_VERSION)/harfbuzz-$(HARFBUZZ_VERSION).tar.xz
PKGS += harfbuzz
ifeq ($(call need_pkg,"harfbuzz"),)
......@@ -16,8 +16,6 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.xz .sum-harfbuzz
$(UNPACK)
$(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-Don-t-treat-Wunused-as-an-error.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment