summaryrefslogtreecommitdiff
path: root/src/timezone/pgtz.h
diff options
context:
space:
mode:
authorTom Lane2016-03-28 19:10:17 +0000
committerTom Lane2016-03-28 19:10:17 +0000
commit1c1a7cbd6a1600c97dfcd9b5dc78a23b5db9bbf6 (patch)
tree83a3722b946a8610306512bcfb2ccc77be745e84 /src/timezone/pgtz.h
parente5a4dea80f2506a7a565508e48aaa52296ff410a (diff)
Sync our copy of the timezone library with IANA release tzcode2016c.
We hadn't done this in about six years, which proves to have been a mistake because there's been a lot of code churn upstream, making the merge rather painful. But putting it off any further isn't going to lessen the pain, and there are at least two incompatible changes that we need to absorb before someone starts complaining that --with-system-tzdata doesn't work at all on their platform, or we get blindsided by a tzdata release that our out-of-date zic can't compile. Last week's "time zone abbreviation differs from POSIX standard" mess was a wake-up call in that regard. This is a sufficiently large patch that I'm afraid to back-patch it immediately, though the foregoing considerations imply that we probably should do so eventually. For the moment, just put it in HEAD so that it can get some testing. Maybe we can wait till the end of the 9.6 beta cycle before deeming it okay.
Diffstat (limited to 'src/timezone/pgtz.h')
-rw-r--r--src/timezone/pgtz.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/timezone/pgtz.h b/src/timezone/pgtz.h
index ad93291d0ac..deee7464ed5 100644
--- a/src/timezone/pgtz.h
+++ b/src/timezone/pgtz.h
@@ -16,25 +16,26 @@
#ifndef _PGTZ_H
#define _PGTZ_H
-#include "tzfile.h"
#include "pgtime.h"
+#include "tzfile.h"
+#define SMALLEST(a, b) (((a) < (b)) ? (a) : (b))
#define BIGGEST(a, b) (((a) > (b)) ? (a) : (b))
struct ttinfo
{ /* time type information */
- long tt_gmtoff; /* UTC offset in seconds */
- int tt_isdst; /* used to set tm_isdst */
+ int32 tt_gmtoff; /* UT offset in seconds */
+ bool tt_isdst; /* used to set tm_isdst */
int tt_abbrind; /* abbreviation list index */
- int tt_ttisstd; /* TRUE if transition is std time */
- int tt_ttisgmt; /* TRUE if transition is UTC */
+ bool tt_ttisstd; /* transition is std time */
+ bool tt_ttisgmt; /* transition is UT */
};
struct lsinfo
{ /* leap second information */
pg_time_t ls_trans; /* transition time */
- long ls_corr; /* correction to apply */
+ int64 ls_corr; /* correction to apply */
};
struct state
@@ -43,14 +44,15 @@ struct state
int timecnt;
int typecnt;
int charcnt;
- int goback;
- int goahead;
+ bool goback;
+ bool goahead;
pg_time_t ats[TZ_MAX_TIMES];
unsigned char types[TZ_MAX_TIMES];
struct ttinfo ttis[TZ_MAX_TYPES];
char chars[BIGGEST(BIGGEST(TZ_MAX_CHARS + 1, 3 /* sizeof gmt */ ),
(2 * (TZ_STRLEN_MAX + 1)))];
struct lsinfo lsis[TZ_MAX_LEAPS];
+ int defaulttype; /* for early times or if no transitions */
};