diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-10-20 13:28:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-10-20 13:28:17 +0200 |
commit | a5236104672ccbb9f7f9c1b4dc70bea95ca5abf6 (patch) | |
tree | b343d552de76d3218d2c8dfb50c12824b37e5237 /external/harfbuzz | |
parent | 4fb9926ebc91082fe0c29a42239a60bc7a1581fd (diff) |
external/harfbuzz: Silence clang-cl -Werror,-Wmicrosoft-enum-value
The code in harfbuzz' src/hb_common.h apparently goes to some length to ensure
that any value of type hb_tag_t (aka unit32_t) can be transported as a value of
the hb_script_t enum type. However, under MSVC any C (or non-fixed C++) enum
type has an underlying type of int, so _HB_SCRIPT_MAX_VALUE of value 0xFFFFFFFF
will cause a -Wmicrosoft-enum-value under clang-cl. To not complicate things
further, acknowledge that converting between hb_tag_t (an unsigned integer type
with 32 value bits) and hb_script_t (a two's-complement signed integer type with
32 value bits) is well-defined under MSVC and drop _HB_SCRIPT_MAX_VALUE (which
appears to be an otherwise unused implementation detail) there.
Change-Id: Ic03dff64a9dd24683c45347fa78699708c269972
Diffstat (limited to 'external/harfbuzz')
-rw-r--r-- | external/harfbuzz/UnpackedTarball_harfbuzz.mk | 1 | ||||
-rwxr-xr-x | external/harfbuzz/clang-cl.patch | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/external/harfbuzz/UnpackedTarball_harfbuzz.mk b/external/harfbuzz/UnpackedTarball_harfbuzz.mk index 9a5560fda96f..7d408d2a2348 100644 --- a/external/harfbuzz/UnpackedTarball_harfbuzz.mk +++ b/external/harfbuzz/UnpackedTarball_harfbuzz.mk @@ -15,6 +15,7 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,harfbuzz,0)) $(eval $(call gb_UnpackedTarball_add_patches,harfbuzz, \ external/harfbuzz/ubsan.patch \ + external/harfbuzz/clang-cl.patch \ )) ifneq ($(ENABLE_RUNTIME_OPTIMIZATIONS),TRUE) diff --git a/external/harfbuzz/clang-cl.patch b/external/harfbuzz/clang-cl.patch new file mode 100755 index 000000000000..5ba470637601 --- /dev/null +++ b/external/harfbuzz/clang-cl.patch @@ -0,0 +1,12 @@ +--- src/hb-common.h ++++ src/hb-common.h +@@ -331,7 +331,9 @@ + * + * http://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html + */ ++#if !defined _MSC_VER /* avoid clang-cl -Wmicrosoft-enum-value */ + _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< skip >*/ ++#endif + _HB_SCRIPT_MAX_VALUE_SIGNED = HB_TAG_MAX_SIGNED /*< skip >*/ + + } hb_script_t; |