Skip to content

Commit 1c61ec7

Browse files
committed
Portability fix for zic.c.
Missed an inttypes.h dependency in previous patch. Per buildfarm.
1 parent 7f36286 commit 1c61ec7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/timezone/README

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ to first run the tzcode source files through a sed filter like this:
117117
-e 's/intmax_t/int64/g' \
118118
-e 's/INT32_MIN/PG_INT32_MIN/g' \
119119
-e 's/INT32_MAX/PG_INT32_MAX/g' \
120+
-e 's/INTMAX_MIN/PG_INT64_MIN/g' \
121+
-e 's/INTMAX_MAX/PG_INT64_MAX/g' \
120122
-e 's/struct[ \t]+tm\b/struct pg_tm/g' \
121123
-e 's/\btime_t\b/pg_time_t/g' \
122124
-e 's/lineno/lineno_t/g' \

src/timezone/zic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -607,17 +607,17 @@ timerange_option(char *timerange)
607607
{
608608
errno = 0;
609609
lo = strtoimax(timerange + 1, &lo_end, 10);
610-
if (lo_end == timerange + 1 || (lo == INTMAX_MAX && errno == ERANGE))
610+
if (lo_end == timerange + 1 || (lo == PG_INT64_MAX && errno == ERANGE))
611611
return false;
612612
}
613613
hi_end = lo_end;
614614
if (lo_end[0] == '/' && lo_end[1] == '@')
615615
{
616616
errno = 0;
617617
hi = strtoimax(lo_end + 2, &hi_end, 10);
618-
if (hi_end == lo_end + 2 || hi == INTMAX_MIN)
618+
if (hi_end == lo_end + 2 || hi == PG_INT64_MIN)
619619
return false;
620-
hi -= !(hi == INTMAX_MAX && errno == ERANGE);
620+
hi -= !(hi == PG_INT64_MAX && errno == ERANGE);
621621
}
622622
if (*hi_end || hi < lo || max_time < lo || hi < min_time)
623623
return false;

0 commit comments

Comments
 (0)