Ignore:
Timestamp:
Jan 13, 2009, 11:13:50 AM (16 years ago)
Author:
Dimitri Glazkov
Message:

2009-01-13 Dmitry Titov <[email protected]>

Reviewed by Darin Adler.

https://bugs.webkit.org/show_bug.cgi?id=23281
Fix the Chromium Win build.
Need to use PLATFORM(WIN_OS) instead of PLATFORM(WIN).
Moved GTK and WX up in #if sequence because they could come with WIN_OS too,
while they have their own implementation even on Windows.

  • wtf/CurrentTime.cpp: (WTF::currentTime):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/CurrentTime.cpp

    r39794 r39866  
    3535#if PLATFORM(MAC)
    3636#include <CoreFoundation/CFDate.h>
    37 #elif PLATFORM(WIN)
     37#elif PLATFORM(GTK)
     38#include <glib.h>
     39#elif PLATFORM(WX)
     40#include <wx/datetime.h>
     41#elif PLATFORM(WIN_OS)
     42// If defined, WIN32_LEAN_AND_MEAN disables timeBeginPeriod/timeEndPeriod.
     43#undef WIN32_LEAN_AND_MEAN
    3844#include <windows.h>
    3945#include <math.h>
     
    4248#include <sys/types.h>
    4349#include <time.h>
    44 #elif PLATFORM(GTK)
    45 #include <glib.h>
    46 #elif PLATFORM(WX)
    47 #include <wx/datetime.h>
    4850#else // Posix systems relying on the gettimeofday()
    4951#include <sys/time.h>
     
    6163}
    6264
    63 #elif PLATFORM(WIN)
     65#elif PLATFORM(GTK)
     66
     67// Note: GTK on Windows will pick up the PLATFORM(WIN) implementation above which provides
     68// better accuracy compared with Windows implementation of g_get_current_time:
     69// (http://www.google.com/codesearch/p?hl=en#HHnNRjks1t0/glib-2.5.2/glib/gmain.c&q=g_get_current_time).
     70// Non-Windows GTK builds could use gettimeofday() directly but for the sake of consistency lets use GTK function.
     71double currentTime()
     72{
     73    GTimeVal now;
     74    g_get_current_time(&now);
     75    return static_cast<double>(now.tv_sec) + static_cast<double>(now.tv_usec / 1000000.0);
     76}
     77
     78#elif PLATFORM(WX)
     79
     80double currentTime()
     81{
     82    wxDateTime now = wxDateTime::UNow();
     83    return (double)now.GetTicks() + (double)(now.GetMillisecond() / 1000.0);
     84}
     85
     86#elif PLATFORM(WIN_OS)
    6487
    6588static LARGE_INTEGER qpcFrequency;
     
    188211}
    189212
    190 #elif PLATFORM(GTK)
    191 
    192 // Note: GTK on Windows will pick up the PLATFORM(WIN) implementation above which provides
    193 // better accuracy compared with Windows implementation of g_get_current_time:
    194 // (http://www.google.com/codesearch/p?hl=en#HHnNRjks1t0/glib-2.5.2/glib/gmain.c&q=g_get_current_time).
    195 // Non-Windows GTK builds could use gettimeofday() directly but for the sake of consistency lets use GTK function.
    196 double currentTime()
    197 {
    198     GTimeVal now;
    199     g_get_current_time(&now);
    200     return static_cast<double>(now.tv_sec) + static_cast<double>(now.tv_usec / 1000000.0);
    201 }
    202 
    203 #elif PLATFORM(WX)
    204 
    205 double currentTime()
    206 {
    207     wxDateTime now = wxDateTime::UNow();
    208     return (double)now.GetTicks() + (double)(now.GetMillisecond() / 1000.0);
    209 }
    210 
    211213#else // Other Posix systems rely on the gettimeofday().
    212214
Note: See TracChangeset for help on using the changeset viewer.