summaryrefslogtreecommitdiffstats
path: root/intl/icu-patches/double-conversion.diff
blob: 8d1471b081c0c7635cf9d6cd8f3153ce404c69a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
diff --git a/intl/icu/source/i18n/number_decimalquantity.cpp b/intl/icu/source/i18n/number_decimalquantity.cpp
--- a/intl/icu/source/i18n/number_decimalquantity.cpp
+++ b/intl/icu/source/i18n/number_decimalquantity.cpp
@@ -11,28 +11,37 @@
 #include <stdlib.h>
 
 #include "unicode/plurrule.h"
 #include "cmemory.h"
 #include "number_decnum.h"
 #include "putilimp.h"
 #include "number_decimalquantity.h"
 #include "number_roundingutils.h"
+#ifdef JS_HAS_INTL_API
+#include "double-conversion/double-conversion.h"
+#else
 #include "double-conversion.h"
+#endif
 #include "charstr.h"
 #include "number_utils.h"
 #include "uassert.h"
 #include "util.h"
 
 using namespace icu;
 using namespace icu::number;
 using namespace icu::number::impl;
 
+#ifdef JS_HAS_INTL_API
+using double_conversion::DoubleToStringConverter;
+using double_conversion::StringToDoubleConverter;
+#else
 using icu::double_conversion::DoubleToStringConverter;
 using icu::double_conversion::StringToDoubleConverter;
+#endif
 
 namespace {
 
 int8_t NEGATIVE_FLAG = 1;
 int8_t INFINITY_FLAG = 2;
 int8_t NAN_FLAG = 4;
 
 /** Helper function for safe subtraction (no overflow). */
diff --git a/intl/icu/source/i18n/number_rounding.cpp b/intl/icu/source/i18n/number_rounding.cpp
--- a/intl/icu/source/i18n/number_rounding.cpp
+++ b/intl/icu/source/i18n/number_rounding.cpp
@@ -5,17 +5,21 @@
 
 #if !UCONFIG_NO_FORMATTING
 
 #include "charstr.h"
 #include "uassert.h"
 #include "unicode/numberformatter.h"
 #include "number_types.h"
 #include "number_decimalquantity.h"
+#ifdef JS_HAS_INTL_API
+#include "double-conversion/double-conversion.h"
+#else
 #include "double-conversion.h"
+#endif
 #include "number_roundingutils.h"
 #include "number_skeletons.h"
 #include "number_decnum.h"
 #include "putilimp.h"
 #include "string_segment.h"
 
 using namespace icu;
 using namespace icu::number;
diff --git a/intl/icu/source/i18n/number_utils.cpp b/intl/icu/source/i18n/number_utils.cpp
--- a/intl/icu/source/i18n/number_utils.cpp
+++ b/intl/icu/source/i18n/number_utils.cpp
@@ -12,26 +12,34 @@
 #include <stdlib.h>
 #include <cmath>
 #include "number_decnum.h"
 #include "number_types.h"
 #include "number_utils.h"
 #include "charstr.h"
 #include "decContext.h"
 #include "decNumber.h"
+#ifdef JS_HAS_INTL_API
+#include "double-conversion/double-conversion.h"
+#else
 #include "double-conversion.h"
+#endif
 #include "fphdlimp.h"
 #include "uresimp.h"
 #include "ureslocs.h"
 
 using namespace icu;
 using namespace icu::number;
 using namespace icu::number::impl;
 
+#ifdef JS_HAS_INTL_API
+using double_conversion::DoubleToStringConverter;
+#else
 using icu::double_conversion::DoubleToStringConverter;
+#endif
 
 
 namespace {
 
 const char16_t*
 doGetPattern(UResourceBundle* res, const char* nsName, const char* patternKey, UErrorCode& publicStatus,
              UErrorCode& localStatus) {
     // Construct the path into the resource bundle
diff --git a/intl/icu/source/i18n/units_converter.cpp b/intl/icu/source/i18n/units_converter.cpp
--- a/intl/icu/source/i18n/units_converter.cpp
+++ b/intl/icu/source/i18n/units_converter.cpp
@@ -2,17 +2,21 @@
 // License & terms of use: http://www.unicode.org/copyright.html
 
 #include "unicode/utypes.h"
 
 #if !UCONFIG_NO_FORMATTING
 
 #include "charstr.h"
 #include "cmemory.h"
+#ifdef JS_HAS_INTL_API
+#include "double-conversion/string-to-double.h"
+#else
 #include "double-conversion-string-to-double.h"
+#endif
 #include "measunit_impl.h"
 #include "putilimp.h"
 #include "uassert.h"
 #include "unicode/errorcode.h"
 #include "unicode/localpointer.h"
 #include "unicode/stringpiece.h"
 #include "units_converter.h"
 #include <algorithm>
@@ -101,17 +105,21 @@ void U_I18N_API Factor::substituteConsta
         this->constantExponents[i] = 0;
     }
 }
 
 namespace {
 
 /* Helpers */
 
+#ifdef JS_HAS_INTL_API
+using double_conversion::StringToDoubleConverter;
+#else
 using icu::double_conversion::StringToDoubleConverter;
+#endif
 
 // TODO: Make this a shared-utility function.
 // Returns `double` from a scientific number(i.e. "1", "2.01" or "3.09E+4")
 double strToDouble(StringPiece strNum, UErrorCode &status) {
     // We are processing well-formed input, so we don't need any special options to
     // StringToDoubleConverter.
     StringToDoubleConverter converter(0, 0, 0, "", "");
     int32_t count;