From 06231f4f07c3fa20ab8e62b469eb1311e07bd3a5 Mon Sep 17 00:00:00 2001 From: Timur Bakeyev Date: Mon, 22 Feb 1999 00:55:21 +0000 Subject: tzname issues 1999-02-22 Timur Bakeyev * configure.in: Added check for langinfo.h and for representation of timezone info - tzname or tm.tm_zone. svn path=/trunk/; revision=682 --- calendar/ChangeLog | 8 ++++++++ calendar/calendar.c | 13 +++++++++++-- calendar/gui/calendar.c | 13 +++++++++++-- calendar/gui/prop.c | 4 ++++ calendar/prop.c | 4 ++++ 5 files changed, 38 insertions(+), 4 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index c3be35257a..6b432cb781 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +1999-02-22 Timur Bakeyev + + * calendar.c: According to configured values, use either tm.tm_zone + or tzname. In last case, also declare it extern. + + * prop.c: langinfo.h not available everywhere. Wrapped. BTW, works + fine without it. + 1999-02-20 Tomas Ogren * main.c (init_username): Made use of g_get_{user,real}_name() instead diff --git a/calendar/calendar.c b/calendar/calendar.c index b451703e8a..024e2d0116 100644 --- a/calendar/calendar.c +++ b/calendar/calendar.c @@ -20,6 +20,10 @@ #include "timeutil.h" #include "../libversit/vcc.h" +#ifdef HAVE_TZNAME +extern char *tzname[2]; +#endif + /* Our day range */ time_t calendar_day_begin, calendar_day_end; @@ -325,16 +329,21 @@ calendar_save (Calendar *cal, char *fname) GList *l; time_t now = time (NULL); struct stat s; + struct tm *tm; if (fname == NULL) fname = cal->filename; /* WE call localtime for the side effect of setting tzname */ - localtime (&now); + tm = localtime (&now); vcal = newVObject (VCCalProp); addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN"); - addPropValue (vcal, VCTimeZoneProp, tzname [0]); +#if defined(HAVE_TM_ZONE) + addPropValue (vcal, VCTimeZoneProp, tm->tm_zone); +#elif defined(HAVE_TZNAME) + addPropValue (vcal, VCTimeZoneProp, tzname[0]); +#endif addPropValue (vcal, VCVersionProp, VERSION); cal->temp = vcal; diff --git a/calendar/gui/calendar.c b/calendar/gui/calendar.c index b451703e8a..024e2d0116 100644 --- a/calendar/gui/calendar.c +++ b/calendar/gui/calendar.c @@ -20,6 +20,10 @@ #include "timeutil.h" #include "../libversit/vcc.h" +#ifdef HAVE_TZNAME +extern char *tzname[2]; +#endif + /* Our day range */ time_t calendar_day_begin, calendar_day_end; @@ -325,16 +329,21 @@ calendar_save (Calendar *cal, char *fname) GList *l; time_t now = time (NULL); struct stat s; + struct tm *tm; if (fname == NULL) fname = cal->filename; /* WE call localtime for the side effect of setting tzname */ - localtime (&now); + tm = localtime (&now); vcal = newVObject (VCCalProp); addPropValue (vcal, VCProdIdProp, "-//GNOME//NONSGML GnomeCalendar//EN"); - addPropValue (vcal, VCTimeZoneProp, tzname [0]); +#if defined(HAVE_TM_ZONE) + addPropValue (vcal, VCTimeZoneProp, tm->tm_zone); +#elif defined(HAVE_TZNAME) + addPropValue (vcal, VCTimeZoneProp, tzname[0]); +#endif addPropValue (vcal, VCVersionProp, VERSION); cal->temp = vcal; diff --git a/calendar/gui/prop.c b/calendar/gui/prop.c index 345c07fe96..2f24f4551e 100644 --- a/calendar/gui/prop.c +++ b/calendar/gui/prop.c @@ -6,7 +6,11 @@ * Federico Mena */ #include +#ifdef HAVE_LANGINGO_H #include +#else +#include +#endif #include #include "gnome-cal.h" #include "gnome-month-item.h" diff --git a/calendar/prop.c b/calendar/prop.c index 345c07fe96..2f24f4551e 100644 --- a/calendar/prop.c +++ b/calendar/prop.c @@ -6,7 +6,11 @@ * Federico Mena */ #include +#ifdef HAVE_LANGINGO_H #include +#else +#include +#endif #include #include "gnome-cal.h" #include "gnome-month-item.h" -- cgit