michael@0: diff --git a/mfbt/decimal/Decimal.h b/mfbt/decimal/Decimal.h michael@0: --- a/mfbt/decimal/Decimal.h michael@0: +++ b/mfbt/decimal/Decimal.h michael@0: @@ -26,16 +26,18 @@ michael@0: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT michael@0: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE michael@0: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. michael@0: */ michael@0: michael@0: #ifndef Decimal_h michael@0: #define Decimal_h michael@0: michael@0: +#include "mozilla/Types.h" michael@0: + michael@0: #include michael@0: #include michael@0: #include michael@0: michael@0: namespace WebCore { michael@0: michael@0: namespace DecimalPrivate { michael@0: class SpecialValueHandler; michael@0: @@ -88,92 +90,92 @@ public: michael@0: FormatClass formatClass() const { return m_formatClass; } michael@0: michael@0: uint64_t m_coefficient; michael@0: int16_t m_exponent; michael@0: FormatClass m_formatClass; michael@0: Sign m_sign; michael@0: }; michael@0: michael@0: - Decimal(int32_t = 0); michael@0: - Decimal(Sign, int exponent, uint64_t coefficient); michael@0: - Decimal(const Decimal&); michael@0: + MFBT_API Decimal(int32_t = 0); michael@0: + MFBT_API Decimal(Sign, int exponent, uint64_t coefficient); michael@0: + MFBT_API Decimal(const Decimal&); michael@0: michael@0: - Decimal& operator=(const Decimal&); michael@0: - Decimal& operator+=(const Decimal&); michael@0: - Decimal& operator-=(const Decimal&); michael@0: - Decimal& operator*=(const Decimal&); michael@0: - Decimal& operator/=(const Decimal&); michael@0: + MFBT_API Decimal& operator=(const Decimal&); michael@0: + MFBT_API Decimal& operator+=(const Decimal&); michael@0: + MFBT_API Decimal& operator-=(const Decimal&); michael@0: + MFBT_API Decimal& operator*=(const Decimal&); michael@0: + MFBT_API Decimal& operator/=(const Decimal&); michael@0: michael@0: - Decimal operator-() const; michael@0: + MFBT_API Decimal operator-() const; michael@0: michael@0: - bool operator==(const Decimal&) const; michael@0: - bool operator!=(const Decimal&) const; michael@0: - bool operator<(const Decimal&) const; michael@0: - bool operator<=(const Decimal&) const; michael@0: - bool operator>(const Decimal&) const; michael@0: - bool operator>=(const Decimal&) const; michael@0: + MFBT_API bool operator==(const Decimal&) const; michael@0: + MFBT_API bool operator!=(const Decimal&) const; michael@0: + MFBT_API bool operator<(const Decimal&) const; michael@0: + MFBT_API bool operator<=(const Decimal&) const; michael@0: + MFBT_API bool operator>(const Decimal&) const; michael@0: + MFBT_API bool operator>=(const Decimal&) const; michael@0: michael@0: - Decimal operator+(const Decimal&) const; michael@0: - Decimal operator-(const Decimal&) const; michael@0: - Decimal operator*(const Decimal&) const; michael@0: - Decimal operator/(const Decimal&) const; michael@0: + MFBT_API Decimal operator+(const Decimal&) const; michael@0: + MFBT_API Decimal operator-(const Decimal&) const; michael@0: + MFBT_API Decimal operator*(const Decimal&) const; michael@0: + MFBT_API Decimal operator/(const Decimal&) const; michael@0: michael@0: int exponent() const michael@0: { michael@0: ASSERT(isFinite()); michael@0: return m_data.exponent(); michael@0: } michael@0: michael@0: bool isFinite() const { return m_data.isFinite(); } michael@0: bool isInfinity() const { return m_data.isInfinity(); } michael@0: bool isNaN() const { return m_data.isNaN(); } michael@0: bool isNegative() const { return sign() == Negative; } michael@0: bool isPositive() const { return sign() == Positive; } michael@0: bool isSpecial() const { return m_data.isSpecial(); } michael@0: bool isZero() const { return m_data.isZero(); } michael@0: michael@0: - Decimal abs() const; michael@0: - Decimal ceiling() const; michael@0: - Decimal floor() const; michael@0: - Decimal remainder(const Decimal&) const; michael@0: - Decimal round() const; michael@0: + MFBT_API Decimal abs() const; michael@0: + MFBT_API Decimal ceiling() const; michael@0: + MFBT_API Decimal floor() const; michael@0: + MFBT_API Decimal remainder(const Decimal&) const; michael@0: + MFBT_API Decimal round() const; michael@0: michael@0: - double toDouble() const; michael@0: + MFBT_API double toDouble() const; michael@0: // Note: toString method supports infinity and nan but fromString not. michael@0: - String toString() const; michael@0: + MFBT_API String toString() const; michael@0: michael@0: - static Decimal fromDouble(double); michael@0: + static MFBT_API Decimal fromDouble(double); michael@0: // fromString supports following syntax EBNF: michael@0: // number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)? michael@0: // | sign? '.' digit+ (exponent-marker sign? digit+)? michael@0: // sign ::= '+' | '-' michael@0: // exponent-marker ::= 'e' | 'E' michael@0: // digit ::= '0' | '1' | ... | '9' michael@0: // Note: fromString doesn't support "infinity" and "nan". michael@0: - static Decimal fromString(const String&); michael@0: - static Decimal infinity(Sign); michael@0: - static Decimal nan(); michael@0: - static Decimal zero(Sign); michael@0: + static MFBT_API Decimal fromString(const String&); michael@0: + static MFBT_API Decimal infinity(Sign); michael@0: + static MFBT_API Decimal nan(); michael@0: + static MFBT_API Decimal zero(Sign); michael@0: michael@0: // You should not use below methods. We expose them for unit testing. michael@0: - explicit Decimal(const EncodedData&); michael@0: + MFBT_API explicit Decimal(const EncodedData&); michael@0: const EncodedData& value() const { return m_data; } michael@0: michael@0: private: michael@0: struct AlignedOperands { michael@0: uint64_t lhsCoefficient; michael@0: uint64_t rhsCoefficient; michael@0: int exponent; michael@0: }; michael@0: michael@0: - Decimal(double); michael@0: - Decimal compareTo(const Decimal&) const; michael@0: + MFBT_API Decimal(double); michael@0: + MFBT_API Decimal compareTo(const Decimal&) const; michael@0: michael@0: - static AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs); michael@0: + static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs); michael@0: static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; } michael@0: michael@0: Sign sign() const { return m_data.sign(); } michael@0: michael@0: EncodedData m_data; michael@0: }; michael@0: michael@0: } // namespace WebCore