diff options
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/JavaScriptCore/ChangeLog | 13 | ||||
| -rw-r--r-- | Source/JavaScriptCore/runtime/MathObject.cpp | 16 | ||||
| -rw-r--r-- | Source/WTF/ChangeLog | 13 | ||||
| -rw-r--r-- | Source/WTF/wtf/MathExtras.h | 22 |
4 files changed, 48 insertions, 16 deletions
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog index 4e661d971..411570a9f 100644 --- a/Source/JavaScriptCore/ChangeLog +++ b/Source/JavaScriptCore/ChangeLog @@ -1,3 +1,16 @@ +2013-01-02 Simon Hausmann <simon.hausmann@digia.com> + + [MinGW-w64] Centralize workaround for pow() implementation + https://bugs.webkit.org/show_bug.cgi?id=105925 + + Reviewed by Sam Weinig. + + As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h + away from the JSC usage. + + * runtime/MathObject.cpp: + (JSC::mathPow): + 2012-12-17 Jonathan Liu <net147@gmail.com> Fix Math.pow implementation with MinGW-w64 diff --git a/Source/JavaScriptCore/runtime/MathObject.cpp b/Source/JavaScriptCore/runtime/MathObject.cpp index f939b8dd4..7634487ad 100644 --- a/Source/JavaScriptCore/runtime/MathObject.cpp +++ b/Source/JavaScriptCore/runtime/MathObject.cpp @@ -232,22 +232,6 @@ static ALWAYS_INLINE double mathPow(double x, double y) ALWAYS_INLINE double mathPow(double x, double y) { -#if COMPILER(MINGW64) - // MinGW-w64 has a custom implementation for pow. - // This handles certain special cases that are different. - if ((x == 0.0 || isinf(x)) && isfinite(y)) { - double f; - if (modf(y, &f) != 0.0) - return ((x == 0.0) ^ (y > 0.0)) ? std::numeric_limits<double>::infinity() : 0.0; - } - - if (x == 2.0) { - int yInt = static_cast<int>(y); - if (y == yInt) - return ldexp(1.0, yInt); - } -#endif - return pow(x, y); } diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog index 296d4d54f..8a2eb9a7d 100644 --- a/Source/WTF/ChangeLog +++ b/Source/WTF/ChangeLog @@ -1,3 +1,16 @@ +2013-01-02 Simon Hausmann <simon.hausmann@digia.com> + + [MinGW-w64] Centralize workaround for pow() implementation + https://bugs.webkit.org/show_bug.cgi?id=105925 + + Reviewed by Sam Weinig. + + As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h + away from the JSC usage. + + * wtf/MathExtras.h: + (wtf_pow): + 2012-11-30 Simon Hausmann <simon.hausmann@digia.com>, Pierre Rossi <pierre.rossi@digia.com> [Qt] Separate Qt WebKit into Qt WebKit and Qt WebKit Widgets diff --git a/Source/WTF/wtf/MathExtras.h b/Source/WTF/wtf/MathExtras.h index df1b23658..5d91bbef5 100644 --- a/Source/WTF/wtf/MathExtras.h +++ b/Source/WTF/wtf/MathExtras.h @@ -226,6 +226,28 @@ inline long int lrint(double flt) #endif // COMPILER(MSVC) +#if COMPILER(MINGW64) +inline double wtf_pow(double x, double y) +{ + // MinGW-w64 has a custom implementation for pow. + // This handles certain special cases that are different. + if ((x == 0.0 || isinf(x)) && isfinite(y)) { + double f; + if (modf(y, &f) != 0.0) + return ((x == 0.0) ^ (y > 0.0)) ? std::numeric_limits<double>::infinity() : 0.0; + } + + if (x == 2.0) { + int yInt = static_cast<int>(y); + if (y == yInt) + return ldexp(1.0, yInt); + } + + return pow(x, y); +} +#define pow(x, y) wtf_pow(x, y) +#endif // COMPILER(MINGW64) + inline double deg2rad(double d) { return d * piDouble / 180.0; } inline double rad2deg(double r) { return r * 180.0 / piDouble; } inline double deg2grad(double d) { return d * 400.0 / 360.0; } |
