[project @ 1997-06-03 23:41:30 by sof]
authorsof <unknown>
Tue, 3 Jun 1997 23:41:30 +0000 (23:41 +0000)
committersof <unknown>
Tue, 3 Jun 1997 23:41:30 +0000 (23:41 +0000)
The use of altzone made condititonal on having HAVE_ALTZONE set

ghc/lib/cbits/timezone.h

index bedafdf..a67faf6 100644 (file)
 #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