1 From c7cac7e0d3bbba4285354c90590a6e6d081fce61 Mon Sep 17 00:00:00 2001
2 From: Bowon Ryu <bowon.ryu@samsung.com>
3 Date: Thu, 24 Dec 2020 13:35:34 +0900
4 Subject: [PATCH] remove icu header dependencies from harfbuzz header
6 Harfbuzz header include icu header that is not Tizen public API.
7 In order to remove icu header from rootstrap, icu header dependencies
12 Change-Id: I94835684a7ddc193c42cc0e2565a200f13c62f8c
13 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
15 src/hb-icu.cc | 17 ++++++++++-------
16 src/hb-icu.h | 6 ++----
17 2 files changed, 12 insertions(+), 11 deletions(-)
19 diff --git a/src/hb-icu.cc b/src/hb-icu.cc
20 index c1dcc24..98de45f 100644
24 #include <unicode/ustring.h>
25 #include <unicode/utf16.h>
26 #include <unicode/uversion.h>
27 +#include <unicode/uscript.h>
29 /* ICU extra semicolon, fixed since 65, https://github.com/unicode-org/icu/commit/480bec3 */
30 #if U_ICU_VERSION_MAJOR_NUM < 65 && (defined(__GNUC__) || defined(__clang__))
35 -hb_icu_script_to_script (UScriptCode script)
36 +hb_icu_script_to_script (unsigned int numScript)
38 + UScriptCode script = (UScriptCode) numScript;
40 if (unlikely (script == USCRIPT_INVALID_CODE))
41 return HB_SCRIPT_INVALID;
43 @@ -90,18 +93,18 @@ hb_icu_script_to_script (UScriptCode script)
44 * Return value: the UScriptCode identifier found
49 hb_icu_script_from_script (hb_script_t script)
51 if (unlikely (script == HB_SCRIPT_INVALID))
52 - return USCRIPT_INVALID_CODE;
53 + return (unsigned int) USCRIPT_INVALID_CODE;
55 unsigned int numScriptCode = 1 + u_getIntPropertyMaxValue (UCHAR_SCRIPT);
56 for (unsigned int i = 0; i < numScriptCode; i++)
57 - if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script))
58 - return (UScriptCode) i;
59 + if (unlikely (hb_icu_script_to_script (i) == script))
62 - return USCRIPT_UNKNOWN;
63 + return (unsigned int) USCRIPT_UNKNOWN;
67 @@ -184,7 +187,7 @@ hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
68 if (unlikely (U_FAILURE (status)))
69 return HB_SCRIPT_UNKNOWN;
71 - return hb_icu_script_to_script (scriptCode);
72 + return hb_icu_script_to_script ((unsigned int) scriptCode);
76 diff --git a/src/hb-icu.h b/src/hb-icu.h
77 index 2db6a7b..47e718c 100644
84 -#include <unicode/uscript.h>
90 -hb_icu_script_to_script (UScriptCode script);
91 +hb_icu_script_to_script (unsigned int numScript);
93 -HB_EXTERN UScriptCode
94 +HB_EXTERN unsigned int
95 hb_icu_script_from_script (hb_script_t script);