diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2020-12-10 09:36:42 +0100 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2021-02-10 14:54:30 +0200 |
commit | 351695310dbc2b78fb924d2637dd8980106a4482 (patch) | |
tree | fc8ca9c684a8e803996f06650340f024d7ef92a7 | |
parent | 1f5616fb2bb8b199c5c238e1e1030a9ec9f875c8 (diff) |
QV4 Engine: Remove MSVC special casing
This patch removes a workaround for old versions of MSVC; we should be
able to rely on the standard library nowadays.
Original-patch-by: Alexander Neumann
Fixes: QTBUG-89203
Change-Id: I8047565000fc7e4e3b8ac28584ff4a479b648274
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit fb4de27768935393744cbd67e9789d325e70e742)
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
-rw-r--r-- | src/qml/jsruntime/qv4global_p.h | 15 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4mathobject.cpp | 1 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4stringobject.cpp | 4 |
3 files changed, 2 insertions, 18 deletions
diff --git a/src/qml/jsruntime/qv4global_p.h b/src/qml/jsruntime/qv4global_p.h index 11a0639c70..7a7720020b 100644 --- a/src/qml/jsruntime/qv4global_p.h +++ b/src/qml/jsruntime/qv4global_p.h @@ -64,21 +64,6 @@ #include <qtqmlglobal.h> #include <private/qtqmlglobal_p.h> -#if defined(Q_CC_MSVC) -#include <float.h> -#include <math.h> - -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); } - -} // namespace std - -inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); } -#endif - // Do certain things depending on whether the JIT is enabled or disabled #if QT_CONFIG(qml_jit) diff --git a/src/qml/jsruntime/qv4mathobject.cpp b/src/qml/jsruntime/qv4mathobject.cpp index 90ffec38c8..bc3fc820ba 100644 --- a/src/qml/jsruntime/qv4mathobject.cpp +++ b/src/qml/jsruntime/qv4mathobject.cpp @@ -47,7 +47,6 @@ #include <QtCore/private/qnumeric_p.h> #include <QtCore/qthreadstorage.h> -#include <math.h> #include <cmath> using namespace QV4; diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp index 3fc1f881b6..c2b32f9010 100644 --- a/src/qml/jsruntime/qv4stringobject.cpp +++ b/src/qml/jsruntime/qv4stringobject.cpp @@ -533,9 +533,9 @@ ReturnedValue StringPrototype::method_lastIndexOf(const FunctionObject *b, const if (std::isnan(position)) position = +qInf(); else - position = trunc(position); + position = std::trunc(position); - int pos = trunc(qMin(qMax(position, 0.0), double(value.length()))); + int pos = std::trunc(qMin(qMax(position, 0.0), double(value.length()))); if (!searchString.isEmpty() && pos == value.length()) --pos; if (searchString.isNull() && pos == 0) |