From d1062b7afa165532b293581026190a36c27b2616 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Wed, 28 Sep 2005 10:46:26 +0000 Subject: Define localtime_r() for Win32 using localtime() (which is thread-safe in 2005-09-28 Tor Lillqvist * message-list.c: Define localtime_r() for Win32 using localtime() (which is thread-safe in Microsoft's C library). svn path=/trunk/; revision=30400 --- mail/ChangeLog | 5 +++-- mail/message-list.c | 10 ++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 8082346153..3f73d8e3c2 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -7,8 +7,9 @@ to literal ASCII strings, so just casefolding ASCII is enough. Also better for portability. - * em-format-html-display.c: Define localtime_r() for Win32 using - localtime() (which is thread-safe in Microsoft's C library). + * em-format-html-display.c + * message-list.c: Define localtime_r() for Win32 using localtime() + (which is thread-safe in Microsoft's C library). * mail-tools.c (mail_tool_do_movemail): Not implemented on Win32. diff --git a/mail/message-list.c b/mail/message-list.c index 861d2d2381..35e0727864 100644 --- a/mail/message-list.c +++ b/mail/message-list.c @@ -82,6 +82,16 @@ #include #endif +#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 t(x) -- cgit v1.2.3