From b6d3bae80317d854d78b5880d8d46cacd0d1a64e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 15 Sep 2014 21:48:30 +0200 Subject: QtDeclarative fixes and workarounds for NaCl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make QtDeclarative run on Native Client. Some of these should be looked at more closely at a later point in time, but will do as workarounds from now. Change-Id: Ifddcb45b190c3a80c6137772a05ababb5466ea22 Reviewed-by: Morten Johan Sørvig --- src/qml/jsruntime/qv4dateobject.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/qml/jsruntime/qv4dateobject.cpp') diff --git a/src/qml/jsruntime/qv4dateobject.cpp b/src/qml/jsruntime/qv4dateobject.cpp index a6e1f47d91..83032c4dc3 100644 --- a/src/qml/jsruntime/qv4dateobject.cpp +++ b/src/qml/jsruntime/qv4dateobject.cpp @@ -609,7 +609,15 @@ static inline QString ToLocaleTimeString(double t) static double getLocalTZA() { -#ifndef Q_OS_WIN +#ifdef Q_OS_WIN + TIME_ZONE_INFORMATION tzInfo; + GetTimeZoneInformation(&tzInfo); + return -tzInfo.Bias * 60.0 * 1000.0; +#elif defined(Q_OS_NACL_NEWLIB) + // ### tzset hidden behind __STRICT_ANSI__ + qWarning("Not implemented: getLocalTZA()"); + return 0; +#else struct tm t; time_t curr; tzset(); @@ -619,10 +627,6 @@ static double getLocalTZA() gmtime_r(&curr, &t); time_t globl = mktime(&t); return (double(locl) - double(globl)) * 1000.0; -#else - TIME_ZONE_INFORMATION tzInfo; - GetTimeZoneInformation(&tzInfo); - return -tzInfo.Bias * 60.0 * 1000.0; #endif } -- cgit v1.2.3