X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/991420e6df6aaf452a0d27851d437c306a31c865..4c2a39bec10bb23d8c4cdf6c15e391ebc0096e1d:/src/msw/wince/time.cpp diff --git a/src/msw/wince/time.cpp b/src/msw/wince/time.cpp index b09a02603d..269333355d 100644 --- a/src/msw/wince/time.cpp +++ b/src/msw/wince/time.cpp @@ -17,10 +17,6 @@ // headers // --------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "window.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -52,8 +48,11 @@ long timezone ; // global variable //////////////////////////////////////////////////////////////////////// // Common code for localtime and gmtime (static) //////////////////////////////////////////////////////////////////////// -static struct tm * __cdecl common_localtime(const time_t * WXUNUSED(t), BOOL bLocal) + +static struct tm * __cdecl common_localtime(const time_t *t, BOOL bLocal) { + wxLongLong i64; + FILETIME ft; wxString str ; SYSTEMTIME SystemTime; TIME_ZONE_INFORMATION pTz; @@ -68,7 +67,19 @@ static struct tm * __cdecl common_localtime(const time_t * WXUNUSED(t), BOOL bLo { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 } }; - ::GetLocalTime(&SystemTime) ; + if (!*t) + ::GetLocalTime(&SystemTime); + else + { + i64 = *t; + i64 = i64 * 10000000 + 116444736000000000; + + ft.dwLowDateTime = i64.GetLo(); + ft.dwHighDateTime = i64.GetHi(); + + ::FileTimeToSystemTime(&ft, &SystemTime); + } + ::GetTimeZoneInformation(&pTz); /////////////////////////////////////////////// @@ -99,6 +110,9 @@ static struct tm * __cdecl common_localtime(const time_t * WXUNUSED(t), BOOL bLo return res; } +extern "C" +{ + //////////////////////////////////////////////////////////////////////// // Receive the number of seconds elapsed since midnight(00:00:00) // and convert a time value and corrects for the local time zone @@ -117,6 +131,7 @@ struct tm * __cdecl gmtime(const time_t *t) return common_localtime(t, DO_GMTIME) ; } +} //////////////////////////////////////////////////////////////////////// // Common code for conversion of struct tm into time_t (static) @@ -145,6 +160,8 @@ static time_t __cdecl common_tm_to_time(int day, int month, int year, int hour, return prog ; } +extern "C" +{ //////////////////////////////////////////////////////////////////////// // Returns the number of seconds elapsed since @@ -183,3 +200,5 @@ size_t __cdecl wcsftime(wchar_t *, size_t, const wchar_t *, const struct tm *) return 0; } + +} // extern "C"