From: Marko Kreen Date: Wed, 3 Dec 2008 11:41:44 +0000 (+0000) Subject: win32: fix locatime X-Git-Tag: pgbouncer_1_3_rc1~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a8d6e97ac43d11dffe4d286783d2f760e3071c6;p=pgbouncer win32: fix locatime --- 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_ */