aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-04-21 16:38:06 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2016-04-22 08:01:11 +0000
commitf656fc588bab4104d531cb46836168da6736a518 (patch)
tree8738295c3a197d1f8f9a1db141c7d9607dd87d7a
parentc71e40b2bdd1dd2f8f4049f3ab2da1446518b9e8 (diff)
Fix compilation with Visual Studio 2015 Update 2 (static build)
Fix linker errors: Qt5Qml.lib(qv4value.obj) : error LNK2005: _nextafter already defined in libucrt.lib(nextafter.obj) Qt5Qml.lib(qv4dateobject.obj) : error LNK2005: _nextafter already defined in libucrt.lib(nextafter.obj) Qt5Qml.lib(qv4runtime.obj) : error LNK2005: _nextafter already defined in libucrt.lib(nextafter.obj) Qt5Qml.lib(qv4globalobject.obj) : error LNK2005: _nextafter already defined in libucrt.lib(nextafter.obj) Qt5Qml.lib(qv4jsonobject.obj) : error LNK2005: _nextafter already defined in libucrt.lib(nextafter.obj) All the defined functions where added in Visual Studio 2013: https://blogs.msdn.microsoft.com/vcblog/2013/07/19/c99-library-support-in-visual-studio-2013/ Change-Id: Ied924b6c93c6b2f81f2793237c9370a70bd6a60c Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
-rw-r--r--src/3rdparty/masm/wtf/Compiler.h3
-rw-r--r--src/3rdparty/masm/wtf/MathExtras.h7
2 files changed, 10 insertions, 0 deletions
diff --git a/src/3rdparty/masm/wtf/Compiler.h b/src/3rdparty/masm/wtf/Compiler.h
index b886f37151..fc3b5c5c08 100644
--- a/src/3rdparty/masm/wtf/Compiler.h
+++ b/src/3rdparty/masm/wtf/Compiler.h
@@ -74,12 +74,15 @@
/* COMPILER(MSVC) - Microsoft Visual C++ */
/* COMPILER(MSVC7_OR_LOWER) - Microsoft Visual C++ 2003 or lower*/
/* COMPILER(MSVC9_OR_LOWER) - Microsoft Visual C++ 2008 or lower*/
+/* COMPILER(MSVC12_OR_LOWER) - Microsoft Visual C++ 2013 or lower*/
#if defined(_MSC_VER)
#define WTF_COMPILER_MSVC 1
#if _MSC_VER < 1400
#define WTF_COMPILER_MSVC7_OR_LOWER 1
#elif _MSC_VER < 1600
#define WTF_COMPILER_MSVC9_OR_LOWER 1
+#elif _MSC_VER < 1800
+#define WTF_COMPILER_MSVC12_OR_LOWER 1
#endif
/* Specific compiler features */
diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h
index 9a85291ae2..9ded0ab736 100644
--- a/src/3rdparty/masm/wtf/MathExtras.h
+++ b/src/3rdparty/masm/wtf/MathExtras.h
@@ -173,11 +173,15 @@ inline float log2f(float num)
inline long long abs(long long num) { return _abs64(num); }
#endif
+#if COMPILER(MSVC12_OR_LOWER)
+
inline double nextafter(double x, double y) { return _nextafter(x, y); }
inline float nextafterf(float x, float y) { return x > y ? x - FLT_EPSILON : x + FLT_EPSILON; }
inline double copysign(double x, double y) { return _copysign(x, y); }
+#endif // COMPILER(MSVC12_OR_LOWER)
+
// Work around a bug in Win, where atan2(+-infinity, +-infinity) yields NaN instead of specific values.
inline double wtf_atan2(double x, double y)
{
@@ -211,6 +215,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 COMPILER(MSVC12_OR_LOWER)
+
// MSVC's math functions do not bring lrint.
inline long int lrint(double flt)
{
@@ -233,6 +239,7 @@ inline long int lrint(double flt)
return static_cast<long int>(intgr);
}
+#endif // COMPILER(MSVC12_OR_LOWER)
#endif // COMPILER(MSVC)
inline double deg2rad(double d) { return d * piDouble / 180.0; }