Changeset 138705 in webkit
- Timestamp:
- Jan 3, 2013 1:54:36 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r138689 r138705 1 2013-01-02 Simon Hausmann <simon.hausmann@digia.com> 2 3 [MinGW-w64] Centralize workaround for pow() implementation 4 https://bugs.webkit.org/show_bug.cgi?id=105925 5 6 Reviewed by Sam Weinig. 7 8 As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h 9 away from the JSC usage. 10 11 * runtime/MathObject.cpp: 12 (JSC::mathPow): 13 1 14 2013-01-02 Gavin Barraclough <barraclough@apple.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/MathObject.cpp
r137895 r138705 233 233 ALWAYS_INLINE double mathPow(double x, double y) 234 234 { 235 #if COMPILER(MINGW64)236 // MinGW-w64 has a custom implementation for pow.237 // This handles certain special cases that are different.238 if ((x == 0.0 || isinf(x)) && isfinite(y)) {239 double f;240 if (modf(y, &f) != 0.0)241 return ((x == 0.0) ^ (y > 0.0)) ? std::numeric_limits<double>::infinity() : 0.0;242 }243 244 if (x == 2.0) {245 int yInt = static_cast<int>(y);246 if (y == yInt)247 return ldexp(1.0, yInt);248 }249 #endif250 251 235 return pow(x, y); 252 236 } -
trunk/Source/WTF/ChangeLog
r138628 r138705 1 2013-01-02 Simon Hausmann <simon.hausmann@digia.com> 2 3 [MinGW-w64] Centralize workaround for pow() implementation 4 https://bugs.webkit.org/show_bug.cgi?id=105925 5 6 Reviewed by Sam Weinig. 7 8 As suggested by Sam, move the MinGW-w64 workaround into MathExtras.h 9 away from the JSC usage. 10 11 * wtf/MathExtras.h: 12 (wtf_pow): 13 1 14 2013-01-02 Adam Barth <abarth@webkit.org> 2 15 -
trunk/Source/WTF/wtf/MathExtras.h
r130826 r138705 227 227 #endif // COMPILER(MSVC) 228 228 229 #if COMPILER(MINGW64) 230 inline double wtf_pow(double x, double y) 231 { 232 // MinGW-w64 has a custom implementation for pow. 233 // This handles certain special cases that are different. 234 if ((x == 0.0 || isinf(x)) && isfinite(y)) { 235 double f; 236 if (modf(y, &f) != 0.0) 237 return ((x == 0.0) ^ (y > 0.0)) ? std::numeric_limits<double>::infinity() : 0.0; 238 } 239 240 if (x == 2.0) { 241 int yInt = static_cast<int>(y); 242 if (y == yInt) 243 return ldexp(1.0, yInt); 244 } 245 246 return pow(x, y); 247 } 248 #define pow(x, y) wtf_pow(x, y) 249 #endif // COMPILER(MINGW64) 250 229 251 inline double deg2rad(double d) { return d * piDouble / 180.0; } 230 252 inline double rad2deg(double r) { return r * 180.0 / piDouble; }
Note: See TracChangeset
for help on using the changeset viewer.