diff options
author | Tom Lane | 2017-04-30 19:13:51 +0000 |
---|---|---|
committer | Tom Lane | 2017-04-30 19:13:51 +0000 |
commit | e18b2c480da478f62781e06488cda56fe1b4e919 (patch) | |
tree | 825d0f3b900921b29715e108861d534b4fb06fd7 /src/timezone/tzfile.h | |
parent | 12d11432b4db8a2ae665287e05f0f6868d35545e (diff) |
Sync our copy of the timezone library with IANA release tzcode2017b.
zic no longer mishandles some transitions in January 2038 when it
attempts to work around Qt bug 53071. This fixes a bug affecting
Pacific/Tongatapu that was introduced in zic 2016e. localtime.c
now contains a workaround, useful when loading a file generated by
a buggy zic.
There are assorted cosmetic changes as well, notably relocation
of a bunch of #defines.
Diffstat (limited to 'src/timezone/tzfile.h')
-rw-r--r-- | src/timezone/tzfile.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/timezone/tzfile.h b/src/timezone/tzfile.h index 32d237b8270..56a5b434727 100644 --- a/src/timezone/tzfile.h +++ b/src/timezone/tzfile.h @@ -100,56 +100,4 @@ struct tzhead #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ -#define SECSPERMIN 60 -#define MINSPERHOUR 60 -#define HOURSPERDAY 24 -#define DAYSPERWEEK 7 -#define DAYSPERNYEAR 365 -#define DAYSPERLYEAR 366 -#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -#define SECSPERDAY ((int32) SECSPERHOUR * HOURSPERDAY) -#define MONSPERYEAR 12 - -#define TM_SUNDAY 0 -#define TM_MONDAY 1 -#define TM_TUESDAY 2 -#define TM_WEDNESDAY 3 -#define TM_THURSDAY 4 -#define TM_FRIDAY 5 -#define TM_SATURDAY 6 - -#define TM_JANUARY 0 -#define TM_FEBRUARY 1 -#define TM_MARCH 2 -#define TM_APRIL 3 -#define TM_MAY 4 -#define TM_JUNE 5 -#define TM_JULY 6 -#define TM_AUGUST 7 -#define TM_SEPTEMBER 8 -#define TM_OCTOBER 9 -#define TM_NOVEMBER 10 -#define TM_DECEMBER 11 - -#define TM_YEAR_BASE 1900 - -#define EPOCH_YEAR 1970 -#define EPOCH_WDAY TM_THURSDAY - -#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0)) - -/* - * Since everything in isleap is modulo 400 (or a factor of 400), we know that - * isleap(y) == isleap(y % 400) - * and so - * isleap(a + b) == isleap((a + b) % 400) - * or - * isleap(a + b) == isleap(a % 400 + b % 400) - * This is true even if % means modulo rather than Fortran remainder - * (which is allowed by C89 but not C99). - * We use this to avoid addition overflow problems. - */ - -#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) - #endif /* !defined TZFILE_H */ |