Fix build on QNX
authorSimon Hausmann <simon.hausmann@digia.com>
Mon, 12 Aug 2013 10:45:24 +0000 (12:45 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 12 Aug 2013 14:21:59 +0000 (16:21 +0200)
There is std::isnan and friends, but math.h also defines isnan as macro,
so std::isnan expands to std::whateverthemacrois and that fails to build.
So include math.h early on, get rid of the macros and then we can continue
to use std::isnan throughout the code base safely.

Change-Id: Ifee580fa2adff396eb6d6f064d4c095a896fb022
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: Fabian Bumberger <fbumberger@rim.com>
src/qml/jsruntime/qv4global_p.h

index 34ce6ae..c5a31eb 100644 (file)
@@ -59,6 +59,14 @@ inline bool signbit(double d) { return _copysign(1.0, d) < 0; }
 inline double trunc(double d) { return d > 0 ? floor(d) : ceil(d); }
 #endif
 
+#if defined(Q_OS_QNX)
+#include <math.h>
+#undef isnan
+#undef isfinite
+#undef isinf
+#undef signbit
+#endif
+
 QT_BEGIN_NAMESPACE
 
 namespace QV4 {