summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-12-01 07:46:40 -0800
committerThiago Macieira <thiago.macieira@intel.com>2017-01-31 23:13:47 +0000
commit3d0f62de8be9af8b406c889b68707448cb2d2b18 (patch)
tree3013d2f86e460ab62c0c8c5bca7f85c8fb602b45 /src/corelib/global
parentb9e82f206c8c5ab3753d851252a68dd1b328aa05 (diff)
qnumeric_p.h: Simplify code to match currently-supported platforms
MSVC < 1800 (older than 2013) is no longer supported, so we can simplify the code. And the implementation for C never worked -- "if it's not C++, let's use a namespace!" Change-Id: Iaeecaffe26af4535b416fffd148c2c6788c43881 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnumeric_p.h11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 01b8772ee1..06658b422d 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -66,7 +66,7 @@
#include <float.h>
#endif
-#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus))
+#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL))
# include <math.h>
# ifdef isnan
# define QT_MATH_H_DEFINES_MACROS
@@ -92,14 +92,7 @@ QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
-#if defined(Q_CC_MSVC) && _MSC_VER < 1800
-static inline bool isnan(double d) { return !!_isnan(d); }
-static inline bool isinf(double d) { return !_finite(d) && !_isnan(d); }
-static inline bool isfinite(double d) { return !!_finite(d); }
-static inline bool isnan(float f) { return !!_isnan(f); }
-static inline bool isinf(float f) { return !_finite(f) && !_isnan(f); }
-static inline bool isfinite(float f) { return !!_finite(f); }
-#elif defined(QT_MATH_H_DEFINES_MACROS)
+#if defined(QT_MATH_H_DEFINES_MACROS)
# undef QT_MATH_H_DEFINES_MACROS
static inline bool isnan(double d) { return math_h_isnan(d); }
static inline bool isinf(double d) { return math_h_isinf(d); }