2012-03-19 09:21:05 -07:00
|
|
|
diff --git a/mfbt/double-conversion/double-conversion.h b/mfbt/double-conversion/double-conversion.h
|
2012-10-30 13:12:22 -07:00
|
|
|
index f98edae..c62b16b 100644
|
2012-03-19 09:21:05 -07:00
|
|
|
--- a/mfbt/double-conversion/double-conversion.h
|
|
|
|
+++ b/mfbt/double-conversion/double-conversion.h
|
|
|
|
@@ -28,6 +28,7 @@
|
|
|
|
#ifndef DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
|
|
|
|
#define DOUBLE_CONVERSION_DOUBLE_CONVERSION_H_
|
|
|
|
|
|
|
|
+#include "mozilla/Types.h"
|
|
|
|
#include "utils.h"
|
|
|
|
|
|
|
|
namespace double_conversion {
|
|
|
|
@@ -129,7 +130,7 @@ class DoubleToStringConverter {
|
|
|
|
}
|
|
|
|
|
|
|
|
// Returns a converter following the EcmaScript specification.
|
|
|
|
- static const DoubleToStringConverter& EcmaScriptConverter();
|
2012-10-30 13:12:22 -07:00
|
|
|
+ static MFBT_API const DoubleToStringConverter& EcmaScriptConverter();
|
2012-03-19 09:21:05 -07:00
|
|
|
|
|
|
|
// Computes the shortest string of digits that correctly represent the input
|
|
|
|
// number. Depending on decimal_in_shortest_low and decimal_in_shortest_high
|
|
|
|
@@ -197,7 +198,7 @@ class DoubleToStringConverter {
|
|
|
|
// The last two conditions imply that the result will never contain more than
|
|
|
|
// 1 + kMaxFixedDigitsBeforePoint + 1 + kMaxFixedDigitsAfterPoint characters
|
|
|
|
// (one additional character for the sign, and one for the decimal point).
|
|
|
|
- bool ToFixed(double value,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API bool ToFixed(double value,
|
2012-03-19 09:21:05 -07:00
|
|
|
int requested_digits,
|
|
|
|
StringBuilder* result_builder) const;
|
|
|
|
|
|
|
|
@@ -229,7 +230,7 @@ class DoubleToStringConverter {
|
|
|
|
// 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).
|
|
|
|
- bool ToExponential(double value,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API bool ToExponential(double value,
|
2012-03-19 09:21:05 -07:00
|
|
|
int requested_digits,
|
|
|
|
StringBuilder* result_builder) const;
|
|
|
|
|
|
|
|
@@ -267,7 +268,7 @@ class DoubleToStringConverter {
|
|
|
|
// The last condition implies that the result will never contain more than
|
|
|
|
// kMaxPrecisionDigits + 7 characters (the sign, the decimal point, the
|
|
|
|
// exponent character, the exponent's sign, and at most 3 exponent digits).
|
|
|
|
- bool ToPrecision(double value,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API bool ToPrecision(double value,
|
2012-03-19 09:21:05 -07:00
|
|
|
int precision,
|
|
|
|
StringBuilder* result_builder) const;
|
|
|
|
|
|
|
|
@@ -292,7 +293,7 @@ class DoubleToStringConverter {
|
|
|
|
// kBase10MaximalLength.
|
|
|
|
// Note that DoubleToAscii null-terminates its input. So the given buffer
|
|
|
|
// should be at least kBase10MaximalLength + 1 characters long.
|
|
|
|
- static const int kBase10MaximalLength = 17;
|
2012-10-30 13:12:22 -07:00
|
|
|
+ static const MFBT_DATA int kBase10MaximalLength = 17;
|
2012-03-19 09:21:05 -07:00
|
|
|
|
|
|
|
// Converts the given double 'v' to ascii. 'v' must not be NaN, +Infinity, or
|
|
|
|
// -Infinity. In SHORTEST_SINGLE-mode this restriction also applies to 'v'
|
|
|
|
@@ -332,7 +333,7 @@ class DoubleToStringConverter {
|
|
|
|
// 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,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ static MFBT_API void DoubleToAscii(double v,
|
2012-03-19 09:21:05 -07:00
|
|
|
DtoaMode mode,
|
|
|
|
int requested_digits,
|
|
|
|
char* buffer,
|
|
|
|
@@ -343,7 +344,7 @@ class DoubleToStringConverter {
|
|
|
|
|
|
|
|
private:
|
|
|
|
// Implementation for ToShortest and ToShortestSingle.
|
|
|
|
- bool ToShortestIeeeNumber(double value,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API bool ToShortestIeeeNumber(double value,
|
2012-03-19 09:21:05 -07:00
|
|
|
StringBuilder* result_builder,
|
|
|
|
DtoaMode mode) const;
|
|
|
|
|
|
|
|
@@ -351,15 +352,15 @@ class DoubleToStringConverter {
|
|
|
|
// 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;
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API bool HandleSpecialValues(double value, StringBuilder* result_builder) const;
|
2012-03-19 09:21:05 -07:00
|
|
|
// 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,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API void CreateExponentialRepresentation(const char* decimal_digits,
|
2012-03-19 09:21:05 -07:00
|
|
|
int length,
|
|
|
|
int exponent,
|
|
|
|
StringBuilder* result_builder) const;
|
|
|
|
// Creates a decimal representation (i.e 1234.5678).
|
|
|
|
- void CreateDecimalRepresentation(const char* decimal_digits,
|
2012-10-30 13:12:22 -07:00
|
|
|
+ MFBT_API void CreateDecimalRepresentation(const char* decimal_digits,
|
2012-03-19 09:21:05 -07:00
|
|
|
int length,
|
|
|
|
int decimal_point,
|
|
|
|
int digits_after_point,
|