X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8c7114c22789e573bbf91dc5bf28f554631b78f8..38aae140acbfd562df1388ae76108efcc52f871c:/src/common/time.cpp diff --git a/src/common/time.cpp b/src/common/time.cpp index 19568e8c59..5b2460ca69 100644 --- a/src/common/time.cpp +++ b/src/common/time.cpp @@ -26,7 +26,7 @@ #include "wx/time.h" #ifndef WX_PRECOMP - #ifdef __WXMSW__ + #ifdef __WINDOWS__ #include "wx/msw/wrapwin.h" #endif #include "wx/intl.h" @@ -36,7 +36,7 @@ #ifndef WX_GMTOFF_IN_TM // Define it for some systems which don't (always) use configure but are // known to have tm_gmtoff field. - #if defined(__WXPALMOS__) || defined(__DARWIN__) + #if defined(__DARWIN__) #define WX_GMTOFF_IN_TM #endif #endif @@ -48,19 +48,12 @@ # endif #endif -#if defined(__MWERKS__) && defined(__WXMSW__) -# undef HAVE_FTIME -# undef HAVE_GETTIMEOFDAY -#endif - -#ifndef __WXPALMOS5__ #ifndef __WXWINCE__ #include #else #include "wx/msw/private.h" #include "wx/msw/wince/time.h" #endif -#endif // __WXPALMOS5__ #if !defined(__WXMAC__) && !defined(__WXWINCE__) @@ -74,16 +67,6 @@ #include #endif -#ifdef __WXPALMOS__ - #include - #include - #include -#endif - -#if defined(__MWERKS__) && wxUSE_UNICODE - #include -#endif - #if defined(__DJGPP__) || defined(__WINE__) #include #include @@ -231,10 +214,6 @@ int wxGetTimeZone() return WX_TIMEZONE; #elif defined(__BORLANDC__) || defined(__MINGW32__) || defined(__VISAGECPP__) return _timezone; - #elif defined(__MWERKS__) - // This is just plain wrong but apparently MetroWerks runtime didn't have - // any way to get the time zone. - return 28800; #else // unknown platform -- assume it has timezone return timezone; #endif // different time zone variables @@ -282,7 +261,7 @@ long wxGetUTCTime() wxLongLong wxGetUTCTimeUSec() { -#if defined(__WXMSW__) +#if defined(__WINDOWS__) FILETIME ft; ::GetSystemTimeAsFileTime(&ft); @@ -313,23 +292,9 @@ wxLongLong wxGetUTCTimeUSec() // Get local time as milliseconds since 00:00:00, Jan 1st 1970 wxLongLong wxGetUTCTimeMillis() { - wxLongLong val = MILLISECONDS_PER_SECOND; - // If possible, use a function which avoids conversions from // broken-up time structures to milliseconds -#if defined(__WXPALMOS__) - DateTimeType thenst; - thenst.second = 0; - thenst.minute = 0; - thenst.hour = 0; - thenst.day = 1; - thenst.month = 1; - thenst.year = 1970; - thenst.weekDay = 5; - uint32_t now = TimGetSeconds(); - uint32_t then = TimDateTimeToSeconds (&thenst); - return SysTimeToMilliSecs(SysTimeInSecs(now - then)); -#elif defined(__WXMSW__) +#if defined(__WINDOWS__) FILETIME ft; ::GetSystemTimeAsFileTime(&ft); @@ -339,7 +304,10 @@ wxLongLong wxGetUTCTimeMillis() t /= 10000; t -= wxLL(11644473600000); // Unix - Windows epochs difference in ms. return t; -#elif defined(HAVE_GETTIMEOFDAY) +#else // !__WINDOWS__ + wxLongLong val = MILLISECONDS_PER_SECOND; + +#if defined(HAVE_GETTIMEOFDAY) struct timeval tp; if ( wxGetTimeOfDay(&tp) != -1 ) { @@ -375,6 +343,8 @@ wxLongLong wxGetUTCTimeMillis() val *= wxGetUTCTime(); return val; #endif // time functions + +#endif // __WINDOWS__/!__WINDOWS__ } wxLongLong wxGetLocalTimeMillis()