summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
2c5c74d)
Code that's conditional on its definition has been kept; just the tests
removed. The comment explaining its purpose has been kept, just without
the "If defined...".
/* tws.h -- time routines.
*/
/* tws.h -- time routines.
*/
-/* If the following is #defined, a timezone given as a numeric-only offset will
+/* A timezone given as a numeric-only offset will
be treated specially if it's in a zone that observes Daylight Saving Time.
For instance, during DST, a Date: like "Mon, 24 Jul 2000 12:31:44 -0700" will
be printed as "Mon, 24 Jul 2000 12:31:44 PDT". Without the code activated by
the following #define, that'd be incorrectly printed as "...MST". */
be treated specially if it's in a zone that observes Daylight Saving Time.
For instance, during DST, a Date: like "Mon, 24 Jul 2000 12:31:44 -0700" will
be printed as "Mon, 24 Jul 2000 12:31:44 PDT". Without the code activated by
the following #define, that'd be incorrectly printed as "...MST". */
-#define ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST 1
struct tws {
int tw_sec; /* seconds after the minute - [0, 61] */
struct tws {
int tw_sec; /* seconds after the minute - [0, 61] */
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
if (flags & TW_DST)
hours++;
if (flags & TW_DST)
hours++;
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
snprintf (buffer, sizeof(buffer), "%s%02d%02d",
offset < 0 ? "-" : "+", abs (hours), abs (mins));
return buffer;
snprintf (buffer, sizeof(buffer), "%s%02d%02d",
offset < 0 ? "-" : "+", abs (hours), abs (mins));
return buffer;
#define SKIPTOSP() { while ( !isspace((unsigned char) *cp++) ) ; \
--cp; }
#define SKIPTOSP() { while ( !isspace((unsigned char) *cp++) ) ; \
--cp; }
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# endif
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# endif
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
INIT();
SKIPTOD();
SETZONE(atoi(cp));
INIT();
SKIPTOD();
SETZONE(atoi(cp));
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */
yyterminate();
}
"-"{D}{d}{d} {
INIT();
SKIPTOD();
SETZONE(-atoi(cp));
yyterminate();
}
"-"{D}{d}{d} {
INIT();
SKIPTOD();
SETZONE(-atoi(cp));
-#ifdef ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST
-#endif /* ADJUST_NUMERIC_ONLY_TZ_OFFSETS_WRT_DST */