Skip to content
Snippets Groups Projects
Commit de22a4d7 authored by sof's avatar sof
Browse files

[project @ 1997-09-03 23:45:41 by sof]

Tidied; timezone now have type TYPE_TIMEZONE
parent 803ecbd4
No related merge requests found
......@@ -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 */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment