1 From d90ac5141407d6c3278bb67784ea8cec1743ff89 Mon Sep 17 00:00:00 2001
2 From: Bowon Ryu <bowon.ryu@samsung.com>
3 Date: Tue, 25 Feb 2020 17:22:46 +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: Iecf2c69345cdb795c63be238895796e1d4adc610
13 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
15 src/hb-icu.cc | 17 ++++++++++-------
16 src/hb-icu.h | 5 ++---
17 2 files changed, 12 insertions(+), 10 deletions(-)
19 diff --git a/src/hb-icu.cc b/src/hb-icu.cc
20 index 985ff02..4767722 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 return hb_script_from_string (uscript_getShortName (script), -1);
48 hb_icu_script_from_script (hb_script_t script)
50 if (unlikely (script == HB_SCRIPT_INVALID))
51 - return USCRIPT_INVALID_CODE;
52 + return (unsigned int) USCRIPT_INVALID_CODE;
54 unsigned int numScriptCode = 1 + u_getIntPropertyMaxValue (UCHAR_SCRIPT);
55 for (unsigned int i = 0; i < numScriptCode; i++)
56 - if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script))
57 - return (UScriptCode) i;
58 + if (unlikely (hb_icu_script_to_script (i) == script))
61 - return USCRIPT_UNKNOWN;
62 + return (unsigned int) USCRIPT_UNKNOWN;
66 @@ -160,7 +163,7 @@ hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
67 if (unlikely (U_FAILURE (status)))
68 return HB_SCRIPT_UNKNOWN;
70 - return hb_icu_script_to_script (scriptCode);
71 + return hb_icu_script_to_script ((unsigned int) scriptCode);
75 diff --git a/src/hb-icu.h b/src/hb-icu.h
76 index 2db6a7b..dc6d7aa 100644
83 -#include <unicode/uscript.h>
89 -hb_icu_script_to_script (UScriptCode script);
90 +hb_icu_script_to_script (unsigned int numScript);
92 -HB_EXTERN UScriptCode
93 +HB_EXTERN unsigned int
94 hb_icu_script_from_script (hb_script_t script);