From: sof Date: Wed, 3 Sep 1997 23:45:41 +0000 (+0000) Subject: [project @ 1997-09-03 23:45:41 by sof] X-Git-Tag: Approximately_1000_patches_recorded~53 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=de22a4d73f9a3ab58a93661180dbbc4653bae259 [project @ 1997-09-03 23:45:41 by sof] Tidied; timezone now have type TYPE_TIMEZONE --- diff --git a/ghc/lib/cbits/timezone.h b/ghc/lib/cbits/timezone.h index a67faf6..7ea664c 100644 --- a/ghc/lib/cbits/timezone.h +++ b/ghc/lib/cbits/timezone.h @@ -18,24 +18,26 @@ #define ZONE(x) (((struct tm *)x)->tm_zone) #define SETZONE(x,z) (((struct tm *)x)->tm_zone = z) #define GMTOFF(x) (((struct tm *)x)->tm_gmtoff) -#else -#if HAVE_TZNAME +#else /* ! HAVE_TM_ZONE */ +# if HAVE_TZNAME extern char *tzname[2]; -#define ZONE(x) (((struct tm *)x)->tm_isdst ? tzname[1] : tzname[0]) -#define SETZONE(x,z) -#else +# define ZONE(x) (((struct tm *)x)->tm_isdst ? tzname[1] : tzname[0]) +# define SETZONE(x,z) +# else /* ! HAVE_TZNAME */ /* 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 +# error Dont know how to get at timezone name on your OS. +# endif /* ! HAVE_TZNAME */ /* Get the offset in secs from UTC, if (struct tm) doesn't supply it. */ -extern time_t timezone; -#if HAVE_ALTZONE + +extern TYPE_TIMEZONE timezone; + +# if HAVE_ALTZONE extern time_t altzone; -#define GMTOFF(x) (((struct tm *)x)->tm_isdst ? altzone : timezone) -#else +# define GMTOFF(x) (((struct tm *)x)->tm_isdst ? altzone : timezone) +# else /* ! HAVE_ALTZONE */ /* Assume that DST offset is 1 hour ... */ -#define GMTOFF(x) (((struct tm *)x)->tm_isdst ? (timezone - 3600) : timezone) -#endif -#endif +# define GMTOFF(x) (((struct tm *)x)->tm_isdst ? (timezone - 3600) : timezone) +# endif /* ! HAVE_ALTZONE */ +#endif /* ! HAVE_TM_ZONE */ -#endif +#endif /* TIMEZONE_H */