From c68be3f708cef3ad5c222836095f96bf2f7e2acc Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 18 Mar 1997 20:50:32 +0000 Subject: [PATCH] [project @ 1997-03-18 20:50:32 by simonpj] Add timezone.h --- ghc/lib/cbits/timezone.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 ghc/lib/cbits/timezone.h diff --git a/ghc/lib/cbits/timezone.h b/ghc/lib/cbits/timezone.h new file mode 100644 index 0000000..bedafdf --- /dev/null +++ b/ghc/lib/cbits/timezone.h @@ -0,0 +1,31 @@ +#ifndef TIMEZONE_H +#define TIMEZONE_H + +#define _OSF_SOURCE + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +#if HAVE_TM_ZONE +#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 +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) +#define GMTOFF(x) (((struct tm *)x)->tm_isdst ? altzone : timezone) +#endif +#endif + +#endif -- 1.7.10.4