changeset 5113:bac62d8d386f

[gaim-migrate @ 5476] Added localtime_r committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sat, 12 Apr 2003 00:10:45 +0000
parents 463b03cd8c90
children e245e686f62f
files src/win32/libc_interface.c src/win32/libc_interface.h
diffstat 2 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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;
+}
--- 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_ */