diff options
author | Simon Hausmann <simon.hausmann@digia.com> | 2013-04-29 10:13:50 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@digia.com> | 2013-04-29 11:22:44 +0200 |
commit | 39d0af39b418da93651d8f73eac687bc7b6cd452 (patch) | |
tree | 3768c39f80e9084e91b739b72f1fb7573390ba9e /src | |
parent | 565e89780caaccc6d7ffed0fc3a2f212fb4da2ec (diff) |
Fix build on Windows
Move MSVC floating point math workarounds into qv4global.h to avoid inclusion of MathExtras.h from semi-public header files
Change-Id: I8c5d672d05c42f653c8aa5c6f5d6e6ee0b3ec2e7
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/masm/wtf/MathExtras.h | 10 | ||||
-rw-r--r-- | src/qml/qml/v4vm/qv4global_p.h | 13 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/3rdparty/masm/wtf/MathExtras.h b/src/3rdparty/masm/wtf/MathExtras.h index b70e468dfa..b08ee678e7 100644 --- a/src/3rdparty/masm/wtf/MathExtras.h +++ b/src/3rdparty/masm/wtf/MathExtras.h @@ -142,7 +142,6 @@ 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)); } inline long lroundf(float num) { return static_cast<long>(roundf(num)); } -inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); } #endif @@ -172,15 +171,6 @@ inline float log2f(float num) inline long long abs(long long num) { return _abs64(num); } #endif -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); } -inline bool signbit(double num) { return _copysign(1.0, num) < 0; } - -} // namespace std - 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; } diff --git a/src/qml/qml/v4vm/qv4global_p.h b/src/qml/qml/v4vm/qv4global_p.h index fa63b8c230..cd360a51f4 100644 --- a/src/qml/qml/v4vm/qv4global_p.h +++ b/src/qml/qml/v4vm/qv4global_p.h @@ -46,6 +46,19 @@ #include <qtqmlglobal.h> +#if defined(Q_CC_MSVC) +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); } +inline bool signbit(double d) { return _copysign(1.0, d) < 0; } + +} // namespace std + +inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } +#endif + QT_BEGIN_NAMESPACE namespace QV4 { |