From dc78e9a595c4a56bb010da91c56795137a94c3fb Mon Sep 17 00:00:00 2001 From: Rein Klazes Date: Thu, 21 Oct 2004 19:56:46 +0000 Subject: [PATCH] - mktime should compute the tm_wday, tm_yday and renormalize the other fields of the supplied tm structure. - add prototype declarations for the time functions. --- dlls/msvcrt/msvcrt.h | 9 +++++++++ dlls/msvcrt/time.c | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index c5397dc3214..b455a6eedbf 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -568,7 +568,13 @@ char* MSVCRT_setlocale(int,const char*); int MSVCRT_fclose(MSVCRT_FILE*); void MSVCRT_terminate(); MSVCRT_FILE* MSVCRT__p__iob(void); +MSVCRT_time_t MSVCRT_mktime(struct MSVCRT_tm *t); +struct MSVCRT_tm* MSVCRT_localtime(const MSVCRT_time_t* secs); +struct MSVCRT_tm* MSVCRT_gmtime(const MSVCRT_time_t* secs); +MSVCRT_clock_t MSVCRT_clock(void); +double MSVCRT_difftime(MSVCRT_time_t time1, MSVCRT_time_t time2); MSVCRT_time_t MSVCRT_time(MSVCRT_time_t*); +void * MSVCRT___p__daylight(void); #ifndef __WINE_MSVCRT_TEST int _write(int,const void*,unsigned int); @@ -590,6 +596,9 @@ int* __p___mb_cur_max(void); unsigned int* __p__fmode(void); MSVCRT_wchar_t* _wcsdup(const MSVCRT_wchar_t*); MSVCRT_wchar_t*** __p__wenviron(void); +char* _strdate(char* date); +char* _strtime(char* date); +void _ftime(struct MSVCRT__timeb *buf); #endif /* FIXME: Functions that we forward to. They shouldn't be defined diff --git a/dlls/msvcrt/time.c b/dlls/msvcrt/time.c index 3031aa1db7c..f19f4898d3b 100644 --- a/dlls/msvcrt/time.c +++ b/dlls/msvcrt/time.c @@ -62,7 +62,6 @@ static struct MSVCRT_tm tm; MSVCRT_time_t MSVCRT_mktime(struct MSVCRT_tm *t) { MSVCRT_time_t secs; - SYSTEMTIME st; FILETIME lft, uft; ULONGLONG time; @@ -80,6 +79,9 @@ MSVCRT_time_t MSVCRT_mktime(struct MSVCRT_tm *t) time = ((ULONGLONG)uft.dwHighDateTime << 32) | uft.dwLowDateTime; secs = time / TICKSPERSEC - SECS_1601_TO_1970; + /* compute tm_wday, tm_yday and renormalize the other fields of the + * tm structure */ + if( MSVCRT_localtime( &secs)) *t = tm; return secs; } -- 2.11.4.GIT