Fix MSVC2013 compilation
authorYuchen Deng <loaden@gmail.com>
Sun, 20 Oct 2013 06:54:25 +0000 (14:54 +0800)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 21 Oct 2013 13:18:15 +0000 (15:18 +0200)
Change-Id: I79b50e786f46c9a15963f09158c18871c95fe093
Reviewed-by: Peter Kümmel <syntheticpp@gmx.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/3rdparty/masm/wtf/MathExtras.h
src/qml/jsruntime/qv4global_p.h

index b08ee67..600a9c7 100644 (file)
@@ -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)); }
index e7b5a67..e0f51d2 100644 (file)
@@ -55,7 +55,9 @@ namespace std {
 inline bool isinf(double d) { return !_finite(d) && !_isnan(d); }
 inline bool isnan(double d) { return !!_isnan(d); }
 inline bool isfinite(double d) { return _finite(d); }
+#if _MSC_VER < 1800
 inline bool signbit(double d) { return _copysign(1.0, d) < 0; }
+#endif
 
 } // namespace std