From 4e52a794ba999c0de0a166ae5e8dac2e67b93964 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 06:56:40 +0200 Subject: win32: add localtime_r() --- win32/mingw.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'win32') diff --git a/win32/mingw.c b/win32/mingw.c index 1a476651a..9ce7bc3ff 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -69,3 +69,10 @@ struct tm *gmtime_r(const time_t *timep, struct tm *result) memcpy(result, gmtime(timep), sizeof(struct tm)); return result; } + +struct tm *localtime_r(const time_t *timep, struct tm *result) +{ + /* localtime() in MSVCRT.DLL is thread-safe, but not reentrant */ + memcpy(result, localtime(timep), sizeof(struct tm)); + return result; +} -- cgit v1.2.3-55-g6feb