timezone, tzname, and tzset() are all POSIX.
Pulled in from nmh. Thanks to David Levine.
dnl CHECK STRUCTURES
dnl ----------------
-AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
-
AC_CHECK_MEMBERS(struct utmp.ut_type,,,[#include <utmp.h>])
AC_STRUCT_DIRENT_D_TYPE
#include <h/tws.h>
#include <time.h>
-#if !defined(HAVE_STRUCT_TM_TM_GMTOFF)
-extern int daylight;
-extern long timezone;
-extern char *tzname[];
-#endif
-
#ifndef abs
# define abs(a) (a >= 0 ? a : -a)
#endif
static struct tws tw;
struct tm *tm;
-#if !defined(HAVE_STRUCT_TM_TM_GMTOFF)
- struct timeb tb;
-#endif
-
if (!clock)
return NULL;
if (tm->tm_isdst)
tw.tw_flags |= TW_DST;
-#ifdef HAVE_STRUCT_TM_TM_GMTOFF
- tw.tw_zone = tm->tm_gmtoff / 60;
- if (tm->tm_isdst) /* if DST is in effect */
- tw.tw_zone -= 60; /* reset to normal offset */
-#else
tzset();
tw.tw_zone = -(timezone / 60);
-#endif
tw.tw_flags &= ~TW_SDAY;
tw.tw_flags |= TW_SEXP;