aboutsummaryrefslogtreecommitdiff
path: root/src/timezone/private.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-09-22 00:04:21 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2017-09-22 00:04:21 -0400
commit3876b16ce3f30fcd8e10738d4449f8c51a695b17 (patch)
tree14f9d9304da277ce1eeefa111a3ec55a1df76631 /src/timezone/private.h
parenta2b1eb23496e9abd695036e3cbb1d39c05618692 (diff)
downloadpostgresql-3876b16ce3f30fcd8e10738d4449f8c51a695b17.tar.gz
postgresql-3876b16ce3f30fcd8e10738d4449f8c51a695b17.zip
Sync our copy of the timezone library with IANA tzcode master.
This patch absorbs a few unreleased fixes in the IANA code. It corresponds to commit 2d8b944c1cec0808ac4f7a9ee1a463c28f9cd00a in https://github.com/eggert/tz. Non-cosmetic changes include: TZDEFRULESTRING is updated to match current US DST practice, rather than what it was over ten years ago. This only matters for interpretation of POSIX-style zone names (e.g., "EST5EDT"), and only if the timezone database doesn't include either an exact match for the zone name or a "posixrules" entry. The latter should not be true in any current Postgres installation, but this could possibly matter when using --with-system-tzdata. Get rid of a nonportable use of "++var" on a bool var. This is part of a larger fix that eliminates some vestigial support for consecutive leap seconds, and adds checks to the "zic" compiler that the data files do not specify that. Remove a couple of ancient compatibility hacks. The IANA crew think these are obsolete, and I tend to agree. But perhaps our buildfarm will think different. Back-patch to all supported branches, in line with our policy that all branches should be using current IANA code. Before v10, this includes application of current pgindent rules, to avoid whitespace problems in future back-patches. Discussion: https://postgr.es/m/E1dsWhf-0000pT-F9@gemulon.postgresql.org
Diffstat (limited to 'src/timezone/private.h')
-rw-r--r--src/timezone/private.h25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/timezone/private.h b/src/timezone/private.h
index e65cd1bb4ec..701112ec5b8 100644
--- a/src/timezone/private.h
+++ b/src/timezone/private.h
@@ -38,26 +38,9 @@
#define EOVERFLOW EINVAL
#endif
-#ifndef WIFEXITED
-#define WIFEXITED(status) (((status) & 0xff) == 0)
-#endif /* !defined WIFEXITED */
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(status) (((status) >> 8) & 0xff)
-#endif /* !defined WEXITSTATUS */
-
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
#define is_digit(c) ((unsigned)(c) - '0' <= 9)
-/*
- * SunOS 4.1.1 libraries lack remove.
- */
-
-#ifndef remove
-extern int unlink(const char *filename);
-
-#define remove unlink
-#endif /* !defined remove */
-
/*
* Finally, some convenience items.
@@ -78,6 +61,10 @@ extern int unlink(const char *filename);
#define MINVAL(t, b) \
((t) (TYPE_SIGNED(t) ? - TWOS_COMPLEMENT(t) - MAXVAL(t, b) : 0))
+/* The extreme time values, assuming no padding. */
+#define TIME_T_MIN MINVAL(pg_time_t, TYPE_BIT(pg_time_t))
+#define TIME_T_MAX MAXVAL(pg_time_t, TYPE_BIT(pg_time_t))
+
/*
* 302 / 1000 is log10(2.0) rounded up.
* Subtract one for the sign bit if the type is signed;
@@ -91,7 +78,7 @@ extern int unlink(const char *filename);
/*
* INITIALIZE(x)
*/
-#define INITIALIZE(x) ((x) = 0)
+#define INITIALIZE(x) ((x) = 0)
#undef _
#define _(msgid) (msgid)
@@ -146,7 +133,7 @@ extern int unlink(const char *filename);
* 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).
+ * (which is allowed by C89 but not by C99 or later).
* We use this to avoid addition overflow problems.
*/