diff options
author | Tor Lillqvist <tml@novell.com> | 2006-06-19 23:20:52 +0800 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 2006-06-19 23:20:52 +0800 |
commit | 00616affbab883a044e1c048c6f887f2f55bd11b (patch) | |
tree | 37f258ccd98d1c3b8e2904853815b04802e1ae6f /widgets | |
parent | ff6bb90a969c201e06a2abbf1852b760331f7c32 (diff) | |
download | gsoc2013-evolution-00616affbab883a044e1c048c6f887f2f55bd11b.tar.gz gsoc2013-evolution-00616affbab883a044e1c048c6f887f2f55bd11b.tar.zst gsoc2013-evolution-00616affbab883a044e1c048c6f887f2f55bd11b.zip |
Define gmtime_r() and localtime_r() macros for Win32. Should not declare
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.
svn path=/trunk/; revision=32176
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/ChangeLog | 7 | ||||
-rw-r--r-- | widgets/e-timezone-dialog/e-timezone-dialog.c | 14 |
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); |