-#define INIT() { cp = yytext;}
-#define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
- tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; \
- SKIPA(); }
-#define SETMON() { cp++; \
- tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \
- SKIPA(); }
-#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; \
- SKIPD(); }
-#define SETYEAR() { tw.tw_year = atoi(cp); \
- SKIPD(); }
-#define SETDAY() { tw.tw_mday = atoi(cp); \
- tw.tw_flags |= TW_YES; \
- SKIPD(); }
-#define SETTIME() { tw.tw_hour = atoi(cp); \
- cp += 2; \
- SKIPTOD(); \
- tw.tw_min = atoi(cp); \
- cp += 2; \
- if(*cp == ':') { \
- tw.tw_sec = atoi(++cp); SKIPD(); } }
-#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \
- tw.tw_flags |= TW_SZEXP; \
- SKIPD(); }
-#define SETDST() { tw.tw_flags |= TW_DST; }
-#define SKIPD() { while ( isdigit(*cp++) ) ; \
- --cp; }
-#define SKIPTOD() { while ( !isdigit(*cp++) ) ; \
- --cp; }
-#define SKIPA() { while ( isalpha(*cp++) ) ; \
- --cp; }
-#define SKIPTOA() { while ( !isalpha(*cp++) ) ; \
- --cp; }
-#define SKIPSP() { while ( isspace(*cp++) ) ; \
- --cp; }
-#define SKIPTOSP() { while ( !isspace(*cp++) ) ; \
- --cp; }
+#define INIT() { cp = yytext;}
+#define SETWDAY() { tw.tw_wday= day_map[(cp[0] & 7) + (cp[1] & 4)]; \
+ tw.tw_flags &= ~TW_SDAY; tw.tw_flags |= TW_SEXP; SKIPA(); }
+#define SETMON() { cp++; tw.tw_mon = month_map[(cp[0] + cp[1]) & 0x1f]; \
+ SKIPA(); }
+#define SETMON_NUM() { tw.tw_mon = atoi(cp)-1; SKIPD(); }
+#define SETYEAR() { tw.tw_year = atoi(cp); SKIPD(); }
+#define SETDAY() { tw.tw_mday = atoi(cp); tw.tw_flags |= TW_YES; SKIPD(); }
+#define SETTIME() { tw.tw_hour = atoi(cp); cp += 2; SKIPTOD(); \
+ tw.tw_min = atoi(cp); cp += 2; if(*cp == ':') { \
+ tw.tw_sec = atoi(++cp); SKIPD(); } }
+#define SETZONE(x) { tw.tw_zone = ((x)/100)*60+(x)%100; \
+ tw.tw_flags |= TW_SZEXP; SKIPD(); }
+#define SETDST() { tw.tw_flags |= TW_DST; }
+#define SKIPD() { while ( isdigit(*cp++) ) ; --cp; }
+#define SKIPTOD() { while ( !isdigit(*cp++) ) ; --cp; }
+#define SKIPA() { while ( isalpha(*cp++) ) ; --cp; }
+#define SKIPTOA() { while ( !isalpha(*cp++) ) ; --cp; }
+#define SKIPSP() { while ( isspace(*cp++) ) ; --cp; }
+#define SKIPTOSP() { while ( !isspace(*cp++) ) ; --cp; }
+
+#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# endif
+#include <time.h>
+
+static void
+zonehack (struct tws *tw)
+{
+ register struct tm *tm;
+
+ if (dmktime (tw) == (time_t) -1)
+ return;
+
+ tm = localtime (&tw->tw_clock);
+ if (tm->tm_isdst) {
+ tw->tw_flags |= TW_DST;
+ tw->tw_zone -= 60;
+ }
+}
+#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */