Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1882)

Unified Diff: Source/wtf/MathExtras.h

Issue 184103006: Reinstate workarounds for atan2, fmod, pow in MathExtras on vs2013 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: use numeric_limits Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/wtf/MathExtrasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/MathExtras.h
diff --git a/Source/wtf/MathExtras.h b/Source/wtf/MathExtras.h
index c4945061e8d2f732a22e99cb69b4b6ce88faf839..42ff1224ad354e230628feacc550786470b1866d 100644
--- a/Source/wtf/MathExtras.h
+++ b/Source/wtf/MathExtras.h
@@ -116,7 +116,12 @@ inline float log2f(float num)
}
#endif
-#if COMPILER(MSVC) && (_MSC_VER < 1800)
+#if COMPILER(MSVC)
+
+// VS2013 has most of the math functions now, but we still need to work
+// around various differences in behavior of Inf.
+
+#if _MSC_VER < 1800
namespace std {
@@ -132,6 +137,8 @@ inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x +
inline double copysign(double x, double y) { return _copysign(x, y); }
+#endif // _MSC_VER
+
// Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values.
inline double wtf_atan2(double x, double y)
{
@@ -165,6 +172,8 @@ inline double wtf_pow(double x, double y) { return y == 0 ? 1 : pow(x, y); }
#define fmod(x, y) wtf_fmod(x, y)
#define pow(x, y) wtf_pow(x, y)
+#if _MSC_VER < 1800
+
// MSVC's math functions do not bring lrint.
inline long int lrint(double flt)
{
@@ -187,6 +196,8 @@ inline long int lrint(double flt)
return static_cast<long int>(intgr);
}
+#endif // _MSC_VER
+
#endif // COMPILER(MSVC)
inline double deg2rad(double d) { return d * piDouble / 180.0; }
« no previous file with comments | « no previous file | Source/wtf/MathExtrasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698