All this is needed for qt-webkit to build if c++0x use is enabled while using gcc-4.6 ... you also need to append -fpermissive to the compiler flags --- src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h +++ src/3rdparty/javascriptcore/JavaScriptCore/wtf/TypeTraits.h @@ -23,6 +23,7 @@ #define TypeTraits_h #include "Platform.h" +#include #if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) #include --- src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h +++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/TypeTraits.h @@ -23,6 +23,7 @@ #define TypeTraits_h #include "Platform.h" +#include #if (defined(__GLIBCXX__) && (__GLIBCXX__ >= 20070724) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) #include --- src/3rdparty/webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ src/3rdparty/webkit/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -1106,7 +1106,7 @@ RegisterID* BytecodeGenerator::emitLoad(RegisterID* dst, double number) // FIXME: Our hash tables won't hold infinity, so we make a new JSValue each time. // Later we can do the extra work to handle that like the other cases. They also don't // work correctly with NaN as a key. - if (isnan(number) || number == HashTraits::emptyValue() || HashTraits::isDeletedValue(number)) + if (std::isnan(number) || number == HashTraits::emptyValue() || HashTraits::isDeletedValue(number)) return emitLoad(dst, jsNumber(number)); JSValue& valueInMap = m_numberMap.add(number, JSValue()).first->second; if (!valueInMap) --- src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h +++ src/3rdparty/webkit/Source/JavaScriptCore/wtf/MathExtras.h @@ -137,8 +137,10 @@ inline double trunc(double num) { return num > 0 ? floor(num) : ceil(num); } inline long long abs(long long num) { return _abs64(num); } #endif +#ifndef __GXX_EXPERIMENTAL_CXX0X__ inline bool isinf(double num) { return !_finite(num) && !_isnan(num); } inline bool isnan(double num) { return !!_isnan(num); } +#endif inline bool signbit(double num) { return _copysign(1.0, num) < 0; } inline double nextafter(double x, double y) { return _nextafter(x, y); } @@ -240,8 +242,10 @@ inline int clampToInteger(unsigned value) #if !COMPILER(MSVC) && !(COMPILER(RVCT) && PLATFORM(BREWMP)) && !OS(SOLARIS) && !OS(SYMBIAN) using std::isfinite; +#ifndef __GXX_EXPERIMENTAL_CXX0X__ using std::isinf; using std::isnan; +#endif using std::signbit; #endif --- src/3rdparty/webkit/Source/WebCore/bindings/js/JSGeolocationCustom.cpp +++ src/3rdparty/webkit/Source/WebCore/bindings/js/JSGeolocationCustom.cpp @@ -80,7 +80,7 @@ static PassRefPtr createPositionOptions(ExecState* exec, JSValu if (exec->hadException()) return 0; // If the value is positive infinity, there's nothing to do. - if (!(isinf(timeoutNumber) && (timeoutNumber > 0))) { + if (!(std::isinf(timeoutNumber) && (timeoutNumber > 0))) { // Wrap to int32 and force non-negative to match behavior of window.setTimeout. options->setTimeout(max(0, timeoutValue.toInt32(exec))); if (exec->hadException()) @@ -95,7 +95,7 @@ static PassRefPtr createPositionOptions(ExecState* exec, JSValu double maximumAgeNumber = maximumAgeValue.toNumber(exec); if (exec->hadException()) return 0; - if (isinf(maximumAgeNumber) && (maximumAgeNumber > 0)) { + if (std::isinf(maximumAgeNumber) && (maximumAgeNumber > 0)) { // If the value is positive infinity, clear maximumAge. options->clearMaximumAge(); } else { --- src/3rdparty/webkit/Source/WebCore/html/HTMLInputElement.cpp +++ src/3rdparty/webkit/Source/WebCore/html/HTMLInputElement.cpp @@ -332,7 +332,7 @@ void HTMLInputElement::applyStep(double count, ExceptionCode& ec) return; } double newValue = current + step * count; - if (isinf(newValue)) { + if (std::isinf(newValue)) { ec = INVALID_STATE_ERR; return; } --- src/3rdparty/webkit/Source/WebCore/html/NumberInputType.cpp +++ src/3rdparty/webkit/Source/WebCore/html/NumberInputType.cpp @@ -132,7 +132,7 @@ bool NumberInputType::stepMismatch(const String& value, double step) const if (!parseToDoubleForNumberType(value, &doubleValue)) return false; doubleValue = fabs(doubleValue - stepBase()); - if (isinf(doubleValue)) + if (std::isinf(doubleValue)) return false; // double's fractional part size is DBL_MAN_DIG-bit. If the current value // is greater than step*2^DBL_MANT_DIG, the following computation for