9bec5d5890d8393038ed44fedf82eeae2c1455c6
[platform/upstream/harfbuzz.git] / patch / remove-icu-header-dependencies-from-harfbuzz-header.patch
1 From 6bce537e813081511d7899a235872ff794dbce1a Mon Sep 17 00:00:00 2001
2 From: Jongmin Lee <jm105.lee@samsung.com>
3 Date: Wed, 4 Dec 2019 09:54:01 +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: Ic73ee83de294c09fe3bf047eb3ed7f7c85bdc8c3
13 ---
14  src/hb-icu.cc | 17 ++++++++++-------
15  src/hb-icu.h  |  5 ++---
16  2 files changed, 12 insertions(+), 10 deletions(-)
17
18 diff --git a/src/hb-icu.cc b/src/hb-icu.cc
19 index c26c91d..7e89f78 100644
20 --- a/src/hb-icu.cc
21 +++ b/src/hb-icu.cc
22 @@ -38,6 +38,7 @@
23  #include <unicode/ustring.h>
24  #include <unicode/utf16.h>
25  #include <unicode/uversion.h>
26 +#include <unicode/uscript.h>
27  
28  
29  /**
30 @@ -51,26 +52,28 @@
31  
32  
33  hb_script_t
34 -hb_icu_script_to_script (UScriptCode script)
35 +hb_icu_script_to_script (unsigned int numScript)
36  {
37 +  UScriptCode script = (UScriptCode) numScript;
38 +
39    if (unlikely (script == USCRIPT_INVALID_CODE))
40      return HB_SCRIPT_INVALID;
41  
42    return hb_script_from_string (uscript_getShortName (script), -1);
43  }
44  
45 -UScriptCode
46 +unsigned int
47  hb_icu_script_from_script (hb_script_t script)
48  {
49    if (unlikely (script == HB_SCRIPT_INVALID))
50 -    return USCRIPT_INVALID_CODE;
51 +    return (unsigned int) USCRIPT_INVALID_CODE;
52  
53    unsigned int numScriptCode = 1 + u_getIntPropertyMaxValue (UCHAR_SCRIPT);
54    for (unsigned int i = 0; i < numScriptCode; i++)
55 -    if (unlikely (hb_icu_script_to_script ((UScriptCode) i) == script))
56 -      return (UScriptCode) i;
57 +    if (unlikely (hb_icu_script_to_script (i) == script))
58 +      return i;
59  
60 -  return USCRIPT_UNKNOWN;
61 +  return (unsigned int) USCRIPT_UNKNOWN;
62  }
63  
64  
65 @@ -153,7 +156,7 @@ hb_icu_unicode_script (hb_unicode_funcs_t *ufuncs HB_UNUSED,
66    if (unlikely (U_FAILURE (status)))
67      return HB_SCRIPT_UNKNOWN;
68  
69 -  return hb_icu_script_to_script (scriptCode);
70 +  return hb_icu_script_to_script ((unsigned int) scriptCode);
71  }
72  
73  static hb_bool_t
74 diff --git a/src/hb-icu.h b/src/hb-icu.h
75 index 2db6a7b..dc6d7aa 100644
76 --- a/src/hb-icu.h
77 +++ b/src/hb-icu.h
78 @@ -31,15 +31,14 @@
79  
80  #include "hb.h"
81  
82 -#include <unicode/uscript.h>
83  
84  HB_BEGIN_DECLS
85  
86  
87  HB_EXTERN hb_script_t
88 -hb_icu_script_to_script (UScriptCode script);
89 +hb_icu_script_to_script (unsigned int numScript);
90  
91 -HB_EXTERN UScriptCode
92 +HB_EXTERN unsigned int
93  hb_icu_script_from_script (hb_script_t script);
94  
95  
96 -- 
97 2.7.4
98