From c35fef9d3b8bb77a7f303e3cd62c86cd00e57f5b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 22 Jul 2016 19:56:41 -0700 Subject: 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 --- src/corelib/global/qnumeric_p.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/corelib/global/qnumeric_p.h') 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 #endif -#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || !defined(__cplusplus) || __cplusplus < 201103L) -#include +#if !defined(Q_CC_MSVC) && (defined(Q_OS_QNX) || defined(Q_CC_INTEL) || !defined(__cplusplus)) +# include +# 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); } -- cgit v1.2.3