diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-09-15 21:48:30 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2016-05-13 13:32:08 +0000 |
commit | b6d3bae80317d854d78b5880d8d46cacd0d1a64e (patch) | |
tree | 4ecd01dac33105436efefd123247b02851918a60 /src/qml/jsruntime/qv4dateobject.cpp | |
parent | 872a05475721ad771bd347d1526035e6e7479d30 (diff) |
QtDeclarative fixes and workarounds for NaClwip/nacl
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 <morten.sorvig@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4dateobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4dateobject.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
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 } |