Changeset 45908 in webkit


Ignore:
Timestamp:
Jul 15, 2009 7:18:38 AM (15 years ago)
Author:
Simon Hausmann
Message:

2009-07-15 Laszlo Gombos <Laszlo Gombos>

Reviewed by Dave Kilzer.

Turn off non-portable date manipulations for SYMBIAN
https://bugs.webkit.org/show_bug.cgi?id=27064

Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards
and place the rules for controlling the guards in Platform.h.
Turn off these newly introduced guards for SYMBIAN.

  • wtf/DateMath.cpp: (WTF::calculateUTCOffset):
  • wtf/DateMath.h: (WTF::GregorianDateTime::GregorianDateTime): (WTF::GregorianDateTime::operator tm):
  • wtf/Platform.h:
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r45907 r45908  
     12009-07-15  Laszlo Gombos  <laszlo.1.gombos@nokia.com>
     2
     3        Reviewed by Dave Kilzer.
     4
     5        Turn off non-portable date manipulations for SYMBIAN
     6        https://bugs.webkit.org/show_bug.cgi?id=27064
     7
     8        Introduce HAVE(TM_GMTOFF), HAVE(TM_ZONE) and HAVE(TIMEGM) guards
     9        and place the rules for controlling the guards in Platform.h.
     10        Turn off these newly introduced guards for SYMBIAN.
     11
     12        * wtf/DateMath.cpp:
     13        (WTF::calculateUTCOffset):
     14        * wtf/DateMath.h:
     15        (WTF::GregorianDateTime::GregorianDateTime):
     16        (WTF::GregorianDateTime::operator tm):
     17        * wtf/Platform.h:
     18
    1192009-07-15  Norbert Leser  <norbert.leser@nokia.com>
    220
  • trunk/JavaScriptCore/wtf/DateMath.cpp

    r44843 r45908  
    376376    localt.tm_yday = 0;
    377377    localt.tm_isdst = 0;
    378 #if PLATFORM(WIN_OS) || PLATFORM(SOLARIS) || COMPILER(RVCT)
     378#if HAVE(TM_GMTOFF)
     379    localt.tm_gmtoff = 0;
     380#endif
     381#if HAVE(TM_ZONE)
     382    localt.tm_zone = 0;
     383#endif
     384   
     385#if HAVE(TIMEGM)
     386    time_t utcOffset = timegm(&localt) - mktime(&localt);
     387#else
    379388    // Using a canned date of 01/01/2009 on platforms with weaker date-handling foo.
    380389    localt.tm_year = 109;
    381390    time_t utcOffset = 1230768000 - mktime(&localt);
    382 #else
    383     localt.tm_zone = 0;
    384     localt.tm_gmtoff = 0;
    385     time_t utcOffset = timegm(&localt) - mktime(&localt);
    386391#endif
    387392
  • trunk/JavaScriptCore/wtf/DateMath.h

    r44508 r45908  
    110110        , isDST(inTm.tm_isdst)
    111111    {
    112 #if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !COMPILER(RVCT)
     112#if HAVE(TM_GMTOFF)
    113113        utcOffset = static_cast<int>(inTm.tm_gmtoff);
     114#else
     115        utcOffset = static_cast<int>(getUTCOffset() / msPerSecond + (isDST ? secondsPerHour : 0));
     116#endif
    114117
     118#if HAVE(TM_ZONE)
    115119        int inZoneSize = strlen(inTm.tm_zone) + 1;
    116120        timeZone = new char[inZoneSize];
    117121        strncpy(timeZone, inTm.tm_zone, inZoneSize);
    118122#else
    119         utcOffset = static_cast<int>(getUTCOffset() / msPerSecond + (isDST ? secondsPerHour : 0));
    120123        timeZone = 0;
    121124#endif
     
    137140        ret.tm_isdst =  isDST;
    138141
    139 #if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !COMPILER(RVCT)
     142#if HAVE(TM_GMTOFF)
    140143        ret.tm_gmtoff = static_cast<long>(utcOffset);
     144#endif
     145#if HAVE(TM_ZONE)
    141146        ret.tm_zone = timeZone;
    142147#endif
  • trunk/JavaScriptCore/wtf/Platform.h

    r45793 r45908  
    406406#endif
    407407
     408#if !PLATFORM(WIN_OS) && !PLATFORM(SOLARIS) && !PLATFORM(SYMBIAN) && !COMPILER(RVCT)
     409#define HAVE_TM_GMTOFF 1
     410#define HAVE_TM_ZONE 1
     411#define HAVE_TIMEGM 1
     412#endif     
     413
    408414#if PLATFORM(DARWIN)
    409415
Note: See TracChangeset for help on using the changeset viewer.