From 766a6d761387b2cedacbb23e255fea5ff0c33b82 Mon Sep 17 00:00:00 2001 From: sof Date: Tue, 3 Jun 1997 23:41:30 +0000 Subject: [PATCH] [project @ 1997-06-03 23:41:30 by sof] The use of altzone made condititonal on having HAVE_ALTZONE set --- ghc/lib/cbits/timezone.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 -- 1.7.10.4