summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Deng <loaden@gmail.com>2013-11-12 21:51:34 +0800
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-16 17:43:23 +0100
commitb12852d4eaadd227f9ced218f64175bd4eb6b9c0 (patch)
tree31e2b046e81cf6ff118f633169aedb8507241271
parentc317e5d8d991537889d674f8ee8c0736ca4f268b (diff)
downloadqtwebkit-b12852d4eaadd227f9ced218f64175bd4eb6b9c0.tar.gz
Fix MSVC2013 compilation
Starting with MSVC 2013, more functions are provided. Task-number: QTBUG-34705 Change-Id: I90bf939ad4503a00d31e81c148c6b4ef8af6caff Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
-rw-r--r--Source/WTF/wtf/MathExtras.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Source/WTF/wtf/MathExtras.h b/Source/WTF/wtf/MathExtras.h
index f07bce6a3..4ff78df9f 100644
--- a/Source/WTF/wtf/MathExtras.h
+++ b/Source/WTF/wtf/MathExtras.h
@@ -123,6 +123,7 @@ inline bool signbit(double x) { struct ieee_double *p = (struct ieee_double *)&x
#if COMPILER(MSVC)
+#if _MSC_VER < 1800
// We must not do 'num + 0.5' or 'num - 0.5' because they can cause precision loss.
static double round(double num)
{
@@ -138,6 +139,7 @@ static float roundf(float num)
return integer - num > 0.5f ? integer - 1.0f : integer;
return integer - num >= 0.5f ? integer - 1.0f : integer;
}
+#endif
inline long long llround(double num) { return static_cast<long long>(round(num)); }
inline long long llroundf(float num) { return static_cast<long long>(roundf(num)); }
inline long lround(double num) { return static_cast<long>(round(num)); }
@@ -177,7 +179,9 @@ namespace std {
inline bool isinf(double num) { return !_finite(num) && !_isnan(num); }
inline bool isnan(double num) { return !!_isnan(num); }
inline bool isfinite(double x) { return _finite(x); }
+#if _MSC_VER < 1800
inline bool signbit(double num) { return _copysign(1.0, num) < 0; }
+#endif
} // namespace std