From: sof Date: Tue, 3 Jun 1997 23:41:30 +0000 (+0000) Subject: [project @ 1997-06-03 23:41:30 by sof] X-Git-Tag: Approximately_1000_patches_recorded~435 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=766a6d761387b2cedacbb23e255fea5ff0c33b82;p=ghc-hetmet.git [project @ 1997-06-03 23:41:30 by sof] The use of altzone made condititonal on having HAVE_ALTZONE set --- diff --git a/ghc/lib/cbits/timezone.h b/ghc/lib/cbits/timezone.h index bedafdf..a67faf6 100644 --- a/ghc/lib/cbits/timezone.h +++ b/ghc/lib/cbits/timezone.h @@ -20,11 +20,21 @@ #define GMTOFF(x) (((struct tm *)x)->tm_gmtoff) #else #if HAVE_TZNAME -extern time_t timezone, altzone; extern char *tzname[2]; #define ZONE(x) (((struct tm *)x)->tm_isdst ? tzname[1] : tzname[0]) #define SETZONE(x,z) +#else +/* We're in trouble. If you should end up here, please report this as a bug. */ +#error Dont know how to get at timezone name on your OS. +#endif +/* Get the offset in secs from UTC, if (struct tm) doesn't supply it. */ +extern time_t timezone; +#if HAVE_ALTZONE +extern time_t altzone; #define GMTOFF(x) (((struct tm *)x)->tm_isdst ? altzone : timezone) +#else +/* Assume that DST offset is 1 hour ... */ +#define GMTOFF(x) (((struct tm *)x)->tm_isdst ? (timezone - 3600) : timezone) #endif #endif