From: Simon Hausmann Date: Thu, 7 Feb 2013 15:52:18 +0000 (+0100) Subject: Fix build on platforms without INFINITY X-Git-Tag: upstream/5.2.1~669^2~659^2~289 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a0a58bf6e27f6ebc19fa1313a64d1acecd5b6345;p=platform%2Fupstream%2Fqtdeclarative.git Fix build on platforms without INFINITY Use Q_INFINITY from qnumeric.h as portable wrapper. Change-Id: I2dc2ef1c5e31ace89730b010c2a884e5b532b01f Reviewed-by: Lars Knoll --- diff --git a/src/v4/qmljs_engine.cpp b/src/v4/qmljs_engine.cpp index 8c5dcfc..9dd5e38 100644 --- a/src/v4/qmljs_engine.cpp +++ b/src/v4/qmljs_engine.cpp @@ -201,7 +201,7 @@ ExecutionEngine::ExecutionEngine(EvalISelFactory *factory) glo->defineReadonlyProperty(this, QStringLiteral("undefined"), Value::undefinedValue()); glo->defineReadonlyProperty(this, QStringLiteral("NaN"), Value::fromDouble(nan(""))); - glo->defineReadonlyProperty(this, QStringLiteral("Infinity"), Value::fromDouble(INFINITY)); + glo->defineReadonlyProperty(this, QStringLiteral("Infinity"), Value::fromDouble(Q_INFINITY)); evalFunction = new (memoryManager) EvalFunction(rootContext); glo->defineDefaultProperty(rootContext, QStringLiteral("eval"), Value::fromObject(evalFunction)); diff --git a/src/v4/qmljs_runtime.cpp b/src/v4/qmljs_runtime.cpp index e192b40..a785f00 100644 --- a/src/v4/qmljs_runtime.cpp +++ b/src/v4/qmljs_runtime.cpp @@ -469,9 +469,9 @@ double __qmljs_string_to_number(const String *string) double d = qstrtod(begin, &end, &ok); if (end - begin != ba.size()) { if (ba == "Infinity" || ba == "+Infinity") - d = INFINITY; + d = Q_INFINITY; else if (ba == "-Infinity") - d = -INFINITY; + d = -Q_INFINITY; else d = nan(""); } diff --git a/src/v4/qv4globalobject.cpp b/src/v4/qv4globalobject.cpp index fe43011..220704b 100644 --- a/src/v4/qv4globalobject.cpp +++ b/src/v4/qv4globalobject.cpp @@ -589,9 +589,9 @@ Value GlobalFunctions::method_parseFloat(ExecutionContext *context) // 4: if (trimmed.startsWith(QLatin1String("Infinity")) || trimmed.startsWith(QLatin1String("+Infinity"))) - return Value::fromDouble(INFINITY); + return Value::fromDouble(Q_INFINITY); if (trimmed.startsWith("-Infinity")) - return Value::fromDouble(-INFINITY); + return Value::fromDouble(-Q_INFINITY); QByteArray ba = trimmed.toLatin1(); bool ok; const char *begin = ba.constData();