From 7670176dd23a4aee7875ea6c20f480d5f3c5a4e4 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 28 Sep 2005 10:39:48 +0000 Subject: Define localtime_r() for Win32 using localtime() (which is thread-safe in 2005-09-28 Tor Lillqvist * em-format-html-display.c: Define localtime_r() for Win32 using localtime() (which is thread-safe in Microsoft's C library). svn path=/trunk/; revision=30398 --- mail/em-format-html-display.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mail/em-format-html-display.c') diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 0e054f1dca..d6719d361a 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -92,6 +92,16 @@ #include "e-attachment.h" #include "e-attachment-bar.h" +#ifdef G_OS_WIN32 +/* Undefine the similar macro from ,it doesn't check if + * localtime() returns NULL. + */ +#undef localtime_r + +/* The localtime() in Microsoft's C library is MT-safe */ +#define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0) +#endif + #define d(x) #define EFHD_TABLE_OPEN "" -- cgit v1.2.3