Commit 28f8d621 authored by Martin Storsjö's avatar Martin Storsjö

contrib: harfbuzz: Skip using the _BitScan intrinsics on mingw

In mingw targets, both when using GCC and Clang, the __GNUC__
intrinsics right above can be used in most cases anyway.

This fixes building with mingw-w64 for armv7/aarch64, which doesn't
implement the _BitScanForward/_BitScanReverse intrinsics yet.

Not upstreaming this fix yet since the correct fix would be to
implement these intrinsics in mingw-w64 for armv7 and aarch64 as well.
parent ece4b7b9
From 35bda45cd1a96de1802c2174d4c4469c4e204154 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin@martin.st>
Date: Mon, 21 May 2018 14:52:41 +0300
Subject: [PATCH] Skip using the _BitScan intrinsics on mingw
In mingw targets, both when using GCC and Clang, the __GNUC__
intrinsics right above can be used in most cases anyway.
This fixes building with mingw-w64 for armv7/aarch64, which doesn't
implement the _BitScanForward/_BitScanReverse intrinsics yet.
---
src/hb-private.hh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/hb-private.hh b/src/hb-private.hh
index daa496e..2fb6e71 100644
--- a/src/hb-private.hh
+++ b/src/hb-private.hh
@@ -380,7 +380,7 @@ _hb_bit_storage (T v)
return sizeof (unsigned long long) * 8 - __builtin_clzll (v);
#endif
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(_MSC_VER)
if (sizeof (T) <= sizeof (unsigned int))
{
unsigned long where;
@@ -453,7 +453,7 @@ _hb_ctz (T v)
return __builtin_ctzll (v);
#endif
-#if defined(_MSC_VER) || defined(__MINGW32__)
+#if defined(_MSC_VER)
if (sizeof (T) <= sizeof (unsigned int))
{
unsigned long where;
--
2.7.4
......@@ -21,6 +21,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.bz2 .sum-harfbuzz
$(APPLY) $(SRC)/harfbuzz/harfbuzz-aarch64.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-clang.patch
$(APPLY) $(SRC)/harfbuzz/Cmake-test.patch
$(APPLY) $(SRC)/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment