aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c10
1 files changed, 10 insertions, 0 deletions
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 <pthread.h>,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 "<table>"