summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2016-07-22 19:56:41 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-08-10 06:42:43 +0000
commitc35fef9d3b8bb77a7f303e3cd62c86cd00e57f5b (patch)
tree4f6ea10ec2bbba597cf02576e46077368c4b0a9a /src/corelib/global
parentfa95eb055401f5264cbc6aca761cb9b5feb4affc (diff)
Fix qnumeric_p.h with ICC's supplied math.h
ICC supplies a math.h header that defines things like: #define isnan( __x__ ) __IMFC99MACRO1ARG_ALL( __x__, isnan, __, f, __, , __, l) So use the already-existing workaround for it. Since Qt 5.7 requires C++11, we can remove the check for that. Change-Id: I149e0540c00745fe8119fffd1463cc5caf341337 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qnumeric_p.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h
index 5705bc29c8..3451b2158d 100644
--- a/src/corelib/global/qnumeric_p.h
+++ b/src/corelib/global/qnumeric_p.h
@@ -66,8 +66,9 @@
#include <float.h>
#endif
-#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || !defined(__cplusplus) || __cplusplus < 201103L)
-#include <math.h>
+#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus))
+# include <math.h>
+# define QT_MATH_H_DEFINES_MACROS
QT_BEGIN_NAMESPACE
namespace qnumeric_std_wrapper {
// the 'using namespace std' below is cases where the stdlib already put the math.h functions in the std namespace and undefined the macros.
@@ -96,7 +97,8 @@ 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(Q_CC_MSVC) && (defined(Q_OS_QNX) || !defined(__cplusplus) || __cplusplus < 201103L)
+#elif 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); }
static inline bool isfinite(double d) { return math_h_isfinite(d); }