Fixed broken patch
[platform/upstream/harfbuzz.git] / patch / remove-icu-header-dependencies-from-harfbuzz-header.patch
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
5
6 Harfbuzz header include icu header that is not Tizen public API.
7 In order to remove icu header from rootstrap, icu header dependencies
8 should be removed.
9
10 @tizen_fix
11
12 Change-Id: I94835684a7ddc193c42cc0e2565a200f13c62f8c
13 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
14 ---
15  src/hb-icu.cc | 17 ++++++++++-------
16  src/hb-icu.h  |  6 ++----
17  2 files changed, 12 insertions(+), 11 deletions(-)
18
19 diff --git a/src/hb-icu.cc b/src/hb-icu.cc
20 index c1dcc24..98de45f 100644
21 --- a/src/hb-icu.cc
22 +++ b/src/hb-icu.cc
23 @@ -40,6 +40,7 @@
24  #include <unicode/ustring.h>
25  #include <unicode/utf16.h>
26  #include <unicode/uversion.h>
27 +#include <unicode/uscript.h>
28  
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__))
31 @@ -72,8 +73,10 @@
32   **/
33  
34  hb_script_t
35 -hb_icu_script_to_script (UScriptCode script)
36 +hb_icu_script_to_script (unsigned int numScript)
37  {
38 +  UScriptCode script = (UScriptCode) numScript;
39 +
40    if (unlikely (script == USCRIPT_INVALID_CODE))
41      return HB_SCRIPT_INVALID;
42  
43 @@ -90,18 +93,18 @@ hb_icu_script_to_script (UScriptCode script)
44   * Return value: the UScriptCode identifier found
45   *
46   **/
47 -UScriptCode
48 +unsigned int
49  hb_icu_script_from_script (hb_script_t script)
50  {
51    if (unlikely (script == HB_SCRIPT_INVALID))
52 -    return USCRIPT_INVALID_CODE;
53 +    return (unsigned int) USCRIPT_INVALID_CODE;
54  
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))
60 +      return i;
61  
62 -  return USCRIPT_UNKNOWN;
63 +  return (unsigned int) USCRIPT_UNKNOWN;
64  }
65  
66  
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;
70  
71 -  return hb_icu_script_to_script (scriptCode);
72 +  return hb_icu_script_to_script ((unsigned int) scriptCode);
73  }
74  
75  static hb_bool_t
76 diff --git a/src/hb-icu.h b/src/hb-icu.h
77 index 2db6a7b..47e718c 100644
78 --- a/src/hb-icu.h
79 +++ b/src/hb-icu.h
80 @@ -31,15 +31,13 @@
81  
82  #include "hb.h"
83  
84 -#include <unicode/uscript.h>
85 -
86  HB_BEGIN_DECLS
87  
88  
89  HB_EXTERN hb_script_t
90 -hb_icu_script_to_script (UScriptCode script);
91 +hb_icu_script_to_script (unsigned int numScript);
92  
93 -HB_EXTERN UScriptCode
94 +HB_EXTERN unsigned int
95  hb_icu_script_from_script (hb_script_t script);
96  
97  
98 -- 
99 2.7.4
100