diff options
Diffstat (limited to 'src/timezone/README')
-rw-r--r-- | src/timezone/README | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/timezone/README b/src/timezone/README index 3c593933c1c..9939aa6dd7e 100644 --- a/src/timezone/README +++ b/src/timezone/README @@ -55,7 +55,7 @@ match properly on the old version. Time Zone code ============== -The code in this directory is currently synced with tzcode release 2019b. +The code in this directory is currently synced with tzcode release 2020a. There are many cosmetic (and not so cosmetic) differences from the original tzcode library, but diffs in the upstream version should usually be propagated to our version. Here are some notes about that. @@ -71,7 +71,14 @@ fixed that.) * We need the code to follow Postgres' portability conventions; this includes relying on configure's results rather than hand-hacked -#defines (see private.h). +#defines (see private.h in particular). + +* Similarly, avoid relying on <stdint.h> features that may not exist on old +systems. In particular this means using Postgres' definitions of the int32 +and int64 typedefs, not int_fast32_t/int_fast64_t. Likewise we use +PG_INT32_MIN/MAX not INT32_MIN/MAX. (Once we desupport all PG versions +that don't require C99, it'd be practical to rely on <stdint.h> and remove +this set of diffs; but that day is not yet.) * Since Postgres is typically built on a system that has its own copy of the <time.h> functions, we must avoid conflicting with those. This @@ -109,6 +116,13 @@ to first run the tzcode source files through a sed filter like this: -e 's|^\*/| */|' \ -e 's/\bregister[ \t]//g' \ -e 's/\bATTRIBUTE_PURE[ \t]//g' \ + -e 's/int_fast32_t/int32/g' \ + -e 's/int_fast64_t/int64/g' \ + -e 's/intmax_t/int64/g' \ + -e 's/INT32_MIN/PG_INT32_MIN/g' \ + -e 's/INT32_MAX/PG_INT32_MAX/g' \ + -e 's/INTMAX_MIN/PG_INT64_MIN/g' \ + -e 's/INTMAX_MAX/PG_INT64_MAX/g' \ -e 's/struct[ \t]+tm\b/struct pg_tm/g' \ -e 's/\btime_t\b/pg_time_t/g' \ -e 's/lineno/lineno_t/g' \ |