Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitacb897b

Browse files
committed
Sync our copy of the timezone library with IANA release tzcode2019a.
This corrects a small bug in zic that caused it to output an incorrectyear-2440 transition in the Africa/Casablanca zone.More interestingly, zic has grown a "-r" option that limits the range ofzone transitions that it will put into the output files. That might beuseful to people who don't like the weird GMT offsets that tzdb likesto use for very old dates. It appears that for dates before the cutofftime specified with -r, zic will use the zone's standard-time offsetas of the cutoff time. So for example one might domake install ZIC_OPTIONS='-r @-1893456000'to cause all dates before 1910-01-01 to be treated as though 1910standard time prevailed indefinitely far back. (Don't blame me forthe unfriendly way of specifying the cutoff time --- it's secondssince or before the Unix epoch. You can use extract(epoch ...)to calculate it.)As usual, back-patch to all supported branches.
1 parentd312de3 commitacb897b

File tree

5 files changed

+237
-83
lines changed

5 files changed

+237
-83
lines changed

‎src/timezone/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ TZDATAFILES = $(srcdir)/data/tzdata.zi
2828
# for POSIX-style timezone specs
2929
POSIXRULES = US/Eastern
3030

31+
# any custom options you might want to pass to zic while installing data files
32+
ZIC_OPTIONS =
33+
3134
# use system timezone data?
3235
ifneq (,$(with_system_tzdata))
3336
overrideCPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
@@ -52,7 +55,7 @@ zic: $(ZICOBJS) | submake-libpgport
5255

5356
install: all installdirs
5457
ifeq (,$(with_system_tzdata))
55-
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
58+
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(ZIC_OPTIONS) $(TZDATAFILES)
5659
endif
5760
$(MAKE) -C tznames $@
5861

‎src/timezone/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ match properly on the old version.
5555
Time Zone code
5656
==============
5757

58-
The code in this directory is currently synced with tzcode release2018g.
58+
The code in this directory is currently synced with tzcode release2019a.
5959
There are many cosmetic (and not so cosmetic) differences from the
6060
original tzcode library, but diffs in the upstream version should usually
6161
be propagated to our version. Here are some notes about that.
@@ -111,8 +111,10 @@ to first run the tzcode source files through a sed filter like this:
111111
-e 's/^([ \t]*)\*\*$/\1 */' \
112112
-e 's|^\*/| */|' \
113113
-e 's/\bregister[ \t]//g' \
114+
-e 's/\bATTRIBUTE_PURE[ \t]//g' \
114115
-e 's/int_fast32_t/int32/g' \
115116
-e 's/int_fast64_t/int64/g' \
117+
-e 's/intmax_t/int64/g' \
116118
-e 's/INT32_MIN/PG_INT32_MIN/g' \
117119
-e 's/INT32_MAX/PG_INT32_MAX/g' \
118120
-e 's/struct[ \t]+tm\b/struct pg_tm/g' \

‎src/timezone/private.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@
4444
/* Unlike <ctype.h>'s isdigit, this also works if c < 0 | c > UCHAR_MAX. */
4545
#defineis_digit(c) ((unsigned)(c) - '0' <= 9)
4646

47+
/* PG doesn't currently rely on <inttypes.h>, so work around strtoimax() */
48+
#undef strtoimax
49+
#ifdefHAVE_STRTOLL
50+
#definestrtoimax strtoll
51+
#else
52+
#definestrtoimax strtol
53+
#endif
54+
4755

4856
/*
4957
* Finally, some convenience items.

‎src/timezone/tzfile.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727
#defineTZDEFAULT"/etc/localtime"
2828
#defineTZDEFRULES"posixrules"
2929

30+
31+
/* See Internet RFC 8536 for more details about the following format. */
32+
3033
/*
3134
* Each file begins with. . .
3235
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp