diff options
3 files changed, 28 insertions, 2 deletions
diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog index 5ab23e6..00d3499 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog +++ b/src/3rdparty/javascriptcore/JavaScriptCore/ChangeLog @@ -1,3 +1,17 @@ +2012-08-08 Patrick Gansterer <paroga@webkit.org> + + [WIN] Use GetTimeZoneInformation() for getting the timezone name + https://bugs.webkit.org/show_bug.cgi?id=91936 + + Reviewed by Ryosuke Niwa. + + The MS CRT implementation of strftime calls the same functions in the background. + Using them directly avoids the overhead of parsing the format string and removes + the dependency on strftime() for WinCE where this function does not exist. + + * runtime/DateConversion.cpp: + (JSC::formatTime): + 2010-07-08 Gavin Barraclough <barraclough@apple.com> Reviewed by Sam Weinig. diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri index 0671e87..29dea36 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/javascriptcore/JavaScriptCore/JavaScriptCore.pri @@ -63,8 +63,6 @@ contains(JAVASCRIPTCORE_JIT,no) { } wince* { - INCLUDEPATH += $$QT.core.sources/../3rdparty/ce-compat - SOURCES += $$QT.core.sources/../3rdparty/ce-compat/ce_time.c DEFINES += WINCEBASIC } diff --git a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConversion.cpp b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConversion.cpp index f129407..2ca70ff 100644 --- a/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConversion.cpp +++ b/src/3rdparty/javascriptcore/JavaScriptCore/runtime/DateConversion.cpp @@ -48,6 +48,10 @@ #include <wtf/DateMath.h> #include <wtf/StringExtras.h> +#if OS(WINDOWS) +#include <windows.h> +#endif + using namespace WTF; namespace JSC { @@ -79,12 +83,22 @@ void formatDateUTCVariant(const GregorianDateTime &t, DateConversionBuffer& buff void formatTime(const GregorianDateTime &t, DateConversionBuffer& buffer) { int offset = abs(gmtoffset(t)); +#if OS(WINDOWS) + TIME_ZONE_INFORMATION timeZoneInformation; + GetTimeZoneInformation(&timeZoneInformation); + const WCHAR* timeZoneName = t.isDST ? timeZoneInformation.DaylightName : timeZoneInformation.StandardName; +#else char timeZoneName[70]; struct tm gtm = t; strftime(timeZoneName, sizeof(timeZoneName), "%Z", >m); +#endif if (timeZoneName[0]) { +#if OS(WINDOWS) + snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT%c%02d%02d (%S)", +#else snprintf(buffer, DateConversionBufferSize, "%02d:%02d:%02d GMT%c%02d%02d (%s)", +#endif t.hour, t.minute, t.second, gmtoffset(t) < 0 ? '-' : '+', offset / (60*60), (offset / 60) % 60, timeZoneName); } else { |