# HG changeset patch # User Herman Bloggs # Date 1050106245 0 # Node ID bac62d8d386f5b0a699d283c4a1f42e67a99d1a0 # Parent 463b03cd8c90428bd8f42dea475b86884a204f46 [gaim-migrate @ 5476] Added localtime_r committer: Tailor Script diff -r 463b03cd8c90 -r bac62d8d386f src/win32/libc_interface.c --- a/src/win32/libc_interface.c Fri Apr 11 21:23:02 2003 +0000 +++ b/src/win32/libc_interface.c Sat Apr 12 00:10:45 2003 +0000 @@ -341,3 +341,15 @@ } } + +/* time.h */ + +struct tm * wgaim_localtime_r (const time_t *time, struct tm *resultp) { + struct tm* tmptm; + + tmptm = localtime(time); + if(resultp && tmptm) + return memcpy(resultp, tmptm, sizeof(struct tm)); + else + return NULL; +} diff -r 463b03cd8c90 -r bac62d8d386f src/win32/libc_interface.h --- a/src/win32/libc_interface.h Fri Apr 11 21:23:02 2003 +0000 +++ b/src/win32/libc_interface.h Sat Apr 12 00:10:45 2003 +0000 @@ -93,4 +93,9 @@ #define mkdir(a,b) _mkdir((a)) #define fchmod(a,b) +/* time.h */ +extern struct tm *wgaim_localtime_r(const time_t *time, struct tm *resultp); +#define localtime_r( time, resultp ) \ +wgaim_localtime_r( ## time ##, ## resultp ## ) + #endif /* _LIBC_INTERFACE_H_ */