X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/11e70ae6658f91558d03d346ec705efa8bac6800..dd9f8b6bb6935360a8271dc3e8749fb026b601a8:/src/msw/wince/time.cpp diff --git a/src/msw/wince/time.cpp b/src/msw/wince/time.cpp index d53f58b69f..6e6915b819 100644 --- a/src/msw/wince/time.cpp +++ b/src/msw/wince/time.cpp @@ -2,7 +2,7 @@ // Name: src/msw/wince/time.cpp // Purpose: Implements missing time functionality for WinCE // Author: Marco Cavallini (MCK) - wx@koansoftware.com -// Modified by: +// Modified by: Vadim Zeitlin for VC8 support // Created: 31-08-2003 // RCS-ID: $Id$ // Copyright: (c) Marco Cavallini @@ -30,6 +30,30 @@ #include "wx/msw/wince/time.h" +#if defined(__VISUALC__) && (__VISUALC__ >= 1400) + +// VC8 does provide the time functions but not the standard ones +#include + +time_t __cdecl time(time_t *t) +{ + __time64_t t64; + if ( !_time64(&t64) ) + return (time_t)-1; + + if ( t ) + *t = (time_t)t64; + + return (time_t)t64; +} + +time_t __cdecl mktime(struct tm *t) +{ + return (time_t)_mktime64(t); +} + +#else // !VC8 + ///////////////////////////////////////////////////////////////////////////////////////////// // // // strftime() - taken from OpenBSD // @@ -445,12 +469,9 @@ label: continue; case 'z': { - int diff; + int diff = -timezone; char const * sign; - if (t->tm_isdst < 0) - continue; - continue; if (diff < 0) { sign = "-"; diff = -diff; @@ -500,6 +521,8 @@ strftime(char * const s, const size_t maxsize, const char *format, const struct extern "C" { +/* Not needed in VS Studio 2005 */ + size_t wcsftime(wchar_t *s, const size_t maxsize, const wchar_t *format, @@ -736,4 +759,4 @@ time_t __cdecl mktime(struct tm *t) } // extern "C" - +#endif // VC8/!VC8