aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--widgets/ChangeLog7
-rw-r--r--widgets/e-timezone-dialog/e-timezone-dialog.c14
2 files changed, 21 insertions, 0 deletions
diff --git a/widgets/ChangeLog b/widgets/ChangeLog
index 123ae16b72..890287aa6d 100644
--- a/widgets/ChangeLog
+++ b/widgets/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-19 Tor Lillqvist <tml@novell.com>
+
+ * e-timezone-dialog/e-timezone-dialog.c: Define gmtime_r() and
+ localtime_r() macros for Win32. Should not declare tzname,
+ timezone and daylight on Win32, they are declared properly in
+ <time.h> already.
+
2006-06-14 Srinivasa Ragavan <sragavan@novell.com>
** Fixes bug #204798 , #235691 , #229132
diff --git a/widgets/e-timezone-dialog/e-timezone-dialog.c b/widgets/e-timezone-dialog/e-timezone-dialog.c
index 799401cb49..c70d8c4ba8 100644
--- a/widgets/e-timezone-dialog/e-timezone-dialog.c
+++ b/widgets/e-timezone-dialog/e-timezone-dialog.c
@@ -37,6 +37,18 @@
#include "e-timezone-dialog.h"
+#ifdef G_OS_WIN32
+/* Undef the similar macros from pthread.h, they don't check if
+ * gmtime() and localtime() return NULL.
+ */
+#undef gmtime_r
+#undef localtime_r
+
+/* The gmtime() and localtime() in Microsoft's C library are MT-safe */
+#define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
+#define localtime_r(tp,tmp) (localtime(tp)?(*(tmp)=*localtime(tp),(tmp)):0)
+#endif
+
#define E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA 0xc070a0ff
#define E_TIMEZONE_DIALOG_MAP_POINT_HOVER_RGBA 0xffff60ff
#define E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_1_RGBA 0xff60e0ff
@@ -66,9 +78,11 @@ struct _ETimezoneDialogPrivate {
GtkWidget *preview_label;
};
+#ifndef G_OS_WIN32 /* Declared properly in time.h already */
extern char *tzname[2];
extern long timezone;
extern int daylight;
+#endif
static void e_timezone_dialog_class_init (ETimezoneDialogClass *class);
static void e_timezone_dialog_init (ETimezoneDialog *etd);