From 2a8d6e97ac43d11dffe4d286783d2f760e3071c6 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Wed, 3 Dec 2008 11:41:44 +0000 Subject: [PATCH] win32: fix locatime --- win32/compat_win32.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/win32/compat_win32.h b/win32/compat_win32.h index 87457e5..536bf5d 100644 --- a/win32/compat_win32.h +++ b/win32/compat_win32.h @@ -7,6 +7,7 @@ #include #include #include +#include #define ECONNABORTED WSAECONNABORTED #define EMSGSIZE WSAEMSGSIZE @@ -200,4 +201,12 @@ struct passwd { }; static inline const struct passwd * getpwnam(const char *u) { return NULL; } +/* fix localtime */ +static inline struct tm *w_localtime(const time_t *timep) { + struct tm *res = localtime(timep); + if (res) res->tm_year += 1900; + return res; +} +#define localtime(a) w_localtime(a) + #endif /* _CONFIG_WIN32_ */ -- 2.40.0