mfbt-abi-markers.patch 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. diff --git a/mfbt/decimal/Decimal.h b/mfbt/decimal/Decimal.h
  2. --- a/mfbt/decimal/Decimal.h
  3. +++ b/mfbt/decimal/Decimal.h
  4. @@ -26,16 +26,18 @@
  5. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  6. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  7. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  8. */
  9. #ifndef Decimal_h
  10. #define Decimal_h
  11. +#include "mozilla/Types.h"
  12. +
  13. #include "platform/PlatformExport.h"
  14. #include "wtf/Allocator.h"
  15. #include "wtf/Assertions.h"
  16. #include "wtf/text/WTFString.h"
  17. #include <stdint.h>
  18. namespace blink {
  19. @@ -91,92 +93,92 @@ public:
  20. FormatClass formatClass() const { return m_formatClass; }
  21. uint64_t m_coefficient;
  22. int16_t m_exponent;
  23. FormatClass m_formatClass;
  24. Sign m_sign;
  25. };
  26. - Decimal(int32_t = 0);
  27. - Decimal(Sign, int exponent, uint64_t coefficient);
  28. - Decimal(const Decimal&);
  29. + MFBT_API explicit Decimal(int32_t = 0);
  30. + MFBT_API Decimal(Sign, int exponent, uint64_t coefficient);
  31. + MFBT_API Decimal(const Decimal&);
  32. - Decimal& operator=(const Decimal&);
  33. - Decimal& operator+=(const Decimal&);
  34. - Decimal& operator-=(const Decimal&);
  35. - Decimal& operator*=(const Decimal&);
  36. - Decimal& operator/=(const Decimal&);
  37. + MFBT_API Decimal& operator=(const Decimal&);
  38. + MFBT_API Decimal& operator+=(const Decimal&);
  39. + MFBT_API Decimal& operator-=(const Decimal&);
  40. + MFBT_API Decimal& operator*=(const Decimal&);
  41. + MFBT_API Decimal& operator/=(const Decimal&);
  42. - Decimal operator-() const;
  43. + MFBT_API Decimal operator-() const;
  44. - bool operator==(const Decimal&) const;
  45. - bool operator!=(const Decimal&) const;
  46. - bool operator<(const Decimal&) const;
  47. - bool operator<=(const Decimal&) const;
  48. - bool operator>(const Decimal&) const;
  49. - bool operator>=(const Decimal&) const;
  50. + MFBT_API bool operator==(const Decimal&) const;
  51. + MFBT_API bool operator!=(const Decimal&) const;
  52. + MFBT_API bool operator<(const Decimal&) const;
  53. + MFBT_API bool operator<=(const Decimal&) const;
  54. + MFBT_API bool operator>(const Decimal&) const;
  55. + MFBT_API bool operator>=(const Decimal&) const;
  56. - Decimal operator+(const Decimal&) const;
  57. - Decimal operator-(const Decimal&) const;
  58. - Decimal operator*(const Decimal&) const;
  59. - Decimal operator/(const Decimal&) const;
  60. + MFBT_API Decimal operator+(const Decimal&) const;
  61. + MFBT_API Decimal operator-(const Decimal&) const;
  62. + MFBT_API Decimal operator*(const Decimal&) const;
  63. + MFBT_API Decimal operator/(const Decimal&) const;
  64. int exponent() const
  65. {
  66. ASSERT(isFinite());
  67. return m_data.exponent();
  68. }
  69. bool isFinite() const { return m_data.isFinite(); }
  70. bool isInfinity() const { return m_data.isInfinity(); }
  71. bool isNaN() const { return m_data.isNaN(); }
  72. bool isNegative() const { return sign() == Negative; }
  73. bool isPositive() const { return sign() == Positive; }
  74. bool isSpecial() const { return m_data.isSpecial(); }
  75. bool isZero() const { return m_data.isZero(); }
  76. - Decimal abs() const;
  77. - Decimal ceil() const;
  78. - Decimal floor() const;
  79. - Decimal remainder(const Decimal&) const;
  80. - Decimal round() const;
  81. + MFBT_API Decimal abs() const;
  82. + MFBT_API Decimal ceil() const;
  83. + MFBT_API Decimal floor() const;
  84. + MFBT_API Decimal remainder(const Decimal&) const;
  85. + MFBT_API Decimal round() const;
  86. - double toDouble() const;
  87. + MFBT_API double toDouble() const;
  88. // Note: toString method supports infinity and nan but fromString not.
  89. - String toString() const;
  90. + MFBT_API String toString() const;
  91. - static Decimal fromDouble(double);
  92. + static MFBT_API Decimal fromDouble(double);
  93. // fromString supports following syntax EBNF:
  94. // number ::= sign? digit+ ('.' digit*) (exponent-marker sign? digit+)?
  95. // | sign? '.' digit+ (exponent-marker sign? digit+)?
  96. // sign ::= '+' | '-'
  97. // exponent-marker ::= 'e' | 'E'
  98. // digit ::= '0' | '1' | ... | '9'
  99. // Note: fromString doesn't support "infinity" and "nan".
  100. - static Decimal fromString(const String&);
  101. - static Decimal infinity(Sign);
  102. - static Decimal nan();
  103. - static Decimal zero(Sign);
  104. + static MFBT_API Decimal fromString(const String&);
  105. + static MFBT_API Decimal infinity(Sign);
  106. + static MFBT_API Decimal nan();
  107. + static MFBT_API Decimal zero(Sign);
  108. // You should not use below methods. We expose them for unit testing.
  109. - explicit Decimal(const EncodedData&);
  110. + MFBT_API explicit Decimal(const EncodedData&);
  111. const EncodedData& value() const { return m_data; }
  112. private:
  113. struct AlignedOperands {
  114. uint64_t lhsCoefficient;
  115. uint64_t rhsCoefficient;
  116. int exponent;
  117. };
  118. - Decimal(double);
  119. - Decimal compareTo(const Decimal&) const;
  120. + MFBT_API explicit Decimal(double);
  121. + MFBT_API Decimal compareTo(const Decimal&) const;
  122. - static AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);
  123. + static MFBT_API AlignedOperands alignOperands(const Decimal& lhs, const Decimal& rhs);
  124. static inline Sign invertSign(Sign sign) { return sign == Negative ? Positive : Negative; }
  125. Sign sign() const { return m_data.sign(); }
  126. EncodedData m_data;
  127. };
  128. } // namespace blink