From 00616affbab883a044e1c048c6f887f2f55bd11b Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 19 Jun 2006 15:20:52 +0000 Subject: Define gmtime_r() and localtime_r() macros for Win32. Should not declare 2006-06-19 Tor Lillqvist * 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 already. svn path=/trunk/; revision=32176 --- widgets/ChangeLog | 7 +++++++ widgets/e-timezone-dialog/e-timezone-dialog.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) 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 + + * 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 + already. + 2006-06-14 Srinivasa Ragavan ** 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); -- cgit v1.2.3