summaryrefslogtreecommitdiffstats
path: root/mfbt/double-conversion/add-mfbt-api-markers.patch
blob: d8e96cea43dd8ed5ec97f0b5b98a6bf9be9312bb (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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
diff --git a/mfbt/double-conversion/double-conversion/double-to-string.h b/mfbt/double-conversion/double-conversion/double-to-string.h
--- a/mfbt/double-conversion/double-conversion/double-to-string.h
+++ b/mfbt/double-conversion/double-conversion/double-to-string.h
@@ -23,16 +23,17 @@
 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef DOUBLE_CONVERSION_DOUBLE_TO_STRING_H_
 #define DOUBLE_CONVERSION_DOUBLE_TO_STRING_H_
 
+#include "mozilla/Types.h"
 #include "utils.h"
 
 namespace double_conversion {
 
 class DoubleToStringConverter {
  public:
   // When calling ToFixed with a double > 10^kMaxFixedDigitsBeforePoint
   // or a requested_digits parameter > kMaxFixedDigitsAfterPoint then the
@@ -192,17 +193,17 @@ class DoubleToStringConverter {
   //
   // Flags: UNIQUE_ZERO and EMIT_POSITIVE_EXPONENT_SIGN.
   // Special values: "Infinity" and "NaN".
   // Lower case 'e' for exponential values.
   // decimal_in_shortest_low: -6
   // decimal_in_shortest_high: 21
   // max_leading_padding_zeroes_in_precision_mode: 6
   // max_trailing_padding_zeroes_in_precision_mode: 0
-  static const DoubleToStringConverter& EcmaScriptConverter();
+  static MFBT_API const DoubleToStringConverter& EcmaScriptConverter();
 
   // Computes the shortest string of digits that correctly represent the input
   // number. Depending on decimal_in_shortest_low and decimal_in_shortest_high
   // (see constructor) it then either returns a decimal representation, or an
   // exponential representation.
   // Example with decimal_in_shortest_low = -6,
   //              decimal_in_shortest_high = 21,
   //              EMIT_POSITIVE_EXPONENT_SIGN activated, and
@@ -277,17 +278,17 @@ class DoubleToStringConverter {
   //     been provided to the constructor,
   //   - 'value' > 10^kMaxFixedDigitsBeforePoint, or
   //   - 'requested_digits' > kMaxFixedDigitsAfterPoint.
   // The last two conditions imply that the result for non-special values never
   // contains more than
   //  1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters
   // (one additional character for the sign, and one for the decimal point).
   // In addition, the buffer must be able to hold the trailing '\0' character.
-  bool ToFixed(double value,
+  MFBT_API bool ToFixed(double value,
                int requested_digits,
                StringBuilder* result_builder) const;
 
   // Computes a representation in exponential format with requested_digits
   // after the decimal point. The last emitted digit is rounded.
   // If requested_digits equals -1, then the shortest exponential representation
   // is computed.
   //
@@ -311,17 +312,17 @@ class DoubleToStringConverter {
   //     been provided to the constructor,
   //   - 'requested_digits' > kMaxExponentialDigits.
   //
   // The last condition implies that the result never contains more than
   // kMaxExponentialDigits + 8 characters (the sign, the digit before the
   // decimal point, the decimal point, the exponent character, the
   // exponent's sign, and at most 3 exponent digits).
   // In addition, the buffer must be able to hold the trailing '\0' character.
-  bool ToExponential(double value,
+  MFBT_API bool ToExponential(double value,
                      int requested_digits,
                      StringBuilder* result_builder) const;
 
 
   // Computes 'precision' leading digits of the given 'value' and returns them
   // either in exponential or decimal format, depending on
   // max_{leading|trailing}_padding_zeroes_in_precision_mode (given to the
   // constructor).
@@ -352,17 +353,17 @@ class DoubleToStringConverter {
   //     been provided to the constructor,
   //   - precision < kMinPericisionDigits
   //   - precision > kMaxPrecisionDigits
   //
   // The last condition implies that the result never contains more than
   // kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the
   // exponent character, the exponent's sign, and at most 3 exponent digits).
   // In addition, the buffer must be able to hold the trailing '\0' character.
-  bool ToPrecision(double value,
+  MFBT_API bool ToPrecision(double value,
                    int precision,
                    StringBuilder* result_builder) const;
 
   enum DtoaMode {
     // Produce the shortest correct representation.
     // For example the output of 0.299999999999999988897 is (the less accurate
     // but correct) 0.3.
     SHORTEST,
@@ -414,44 +415,44 @@ class DoubleToStringConverter {
   // DoubleToAscii expects the given buffer to be big enough to hold all
   // digits and a terminating null-character. In SHORTEST-mode it expects a
   // buffer of at least kBase10MaximalLength + 1. In all other modes the
   // requested_digits parameter and the padding-zeroes limit the size of the
   // output. Don't forget the decimal point, the exponent character and the
   // terminating null-character when computing the maximal output size.
   // The given length is only used in debug mode to ensure the buffer is big
   // enough.
-  static void DoubleToAscii(double v,
+  static MFBT_API void DoubleToAscii(double v,
                             DtoaMode mode,
                             int requested_digits,
                             char* buffer,
                             int buffer_length,
                             bool* sign,
                             int* length,
                             int* point);
 
  private:
   // Implementation for ToShortest and ToShortestSingle.
-  bool ToShortestIeeeNumber(double value,
+  MFBT_API bool ToShortestIeeeNumber(double value,
                             StringBuilder* result_builder,
                             DtoaMode mode) const;
 
   // If the value is a special value (NaN or Infinity) constructs the
   // corresponding string using the configured infinity/nan-symbol.
   // If either of them is NULL or the value is not special then the
   // function returns false.
-  bool HandleSpecialValues(double value, StringBuilder* result_builder) const;
+  MFBT_API bool HandleSpecialValues(double value, StringBuilder* result_builder) const;
   // Constructs an exponential representation (i.e. 1.234e56).
   // The given exponent assumes a decimal point after the first decimal digit.
-  void CreateExponentialRepresentation(const char* decimal_digits,
+  MFBT_API void CreateExponentialRepresentation(const char* decimal_digits,
                                        int length,
                                        int exponent,
                                        StringBuilder* result_builder) const;
   // Creates a decimal representation (i.e 1234.5678).
-  void CreateDecimalRepresentation(const char* decimal_digits,
+  MFBT_API void CreateDecimalRepresentation(const char* decimal_digits,
                                    int length,
                                    int decimal_point,
                                    int digits_after_point,
                                    StringBuilder* result_builder) const;
 
   const int flags_;
   const char* const infinity_symbol_;
   const char* const nan_symbol_;
diff --git a/mfbt/double-conversion/double-conversion/string-to-double.h b/mfbt/double-conversion/double-conversion/string-to-double.h
--- a/mfbt/double-conversion/double-conversion/string-to-double.h
+++ b/mfbt/double-conversion/double-conversion/string-to-double.h
@@ -23,16 +23,17 @@
 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 #ifndef DOUBLE_CONVERSION_STRING_TO_DOUBLE_H_
 #define DOUBLE_CONVERSION_STRING_TO_DOUBLE_H_
 
+#include "mozilla/Types.h"
 #include "utils.h"
 
 namespace double_conversion {
 
 class StringToDoubleConverter {
  public:
   // Enumeration for allowing octals and ignoring junk when converting
   // strings to numbers.
@@ -178,34 +179,34 @@ class StringToDoubleConverter {
         separator_(separator) {
   }
 
   // Performs the conversion.
   // The output parameter 'processed_characters_count' is set to the number
   // of characters that have been processed to read the number.
   // Spaces than are processed with ALLOW_{LEADING|TRAILING}_SPACES are included
   // in the 'processed_characters_count'. Trailing junk is never included.
-  double StringToDouble(const char* buffer,
+  MFBT_API double StringToDouble(const char* buffer,
                         int length,
                         int* processed_characters_count) const;
 
   // Same as StringToDouble above but for 16 bit characters.
-  double StringToDouble(const uc16* buffer,
+  MFBT_API double StringToDouble(const uc16* buffer,
                         int length,
                         int* processed_characters_count) const;
 
   // Same as StringToDouble but reads a float.
   // Note that this is not equivalent to static_cast<float>(StringToDouble(...))
   // due to potential double-rounding.
-  float StringToFloat(const char* buffer,
+  MFBT_API float StringToFloat(const char* buffer,
                       int length,
                       int* processed_characters_count) const;
 
   // Same as StringToFloat above but for 16 bit characters.
-  float StringToFloat(const uc16* buffer,
+  MFBT_API float StringToFloat(const uc16* buffer,
                       int length,
                       int* processed_characters_count) const;
 
   // Same as StringToDouble for T = double, and StringToFloat for T = float.
   template <typename T>
   T StringTo(const char* buffer,
              int length,
              int* processed_characters_count) const;