1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2026-05-06 20:29:22 +00:00

Port to x32 by fixing type incompatibility with POSIX.

Reported by Elliott Hughes in
<http://mm.icann.org/pipermail/tz/2013-September/020376.html>.
* localtime.c (timezone) [USG_COMPAT]:
(altzone) [ALTZONE]: Now long, not time_t.
* strftime.c (_fmt): Use long, not int, to store timezone.
* NEWS: Document this.
This commit is contained in:
Paul Eggert
2013-09-24 18:42:34 -07:00
parent e28afbbac3
commit 6e770de058
3 changed files with 13 additions and 3 deletions

10
NEWS
View File

@@ -13,6 +13,16 @@ Unreleased, experimental changes
Palestine will fall back at 00:00, not 01:00. (Thanks to Steffen Thorsen.)
Changes affecting API
The types of the global variables 'timezone' and 'altzone' (if present)
have been changed back to 'long'. This is required for 'timezone'
by POSIX, and for 'altzone' by common practice, e.g., Solaris 11.
These variables were originally 'long' in the tz code, but were
mistakenly changed to 'time_t' in 1987; nobody reported the
incompatibility until now. The difference matters on x32, where
'long' is 32 bits and 'time_t' is 64. (Thanks to Elliott Hughes.)
Changes affecting the build procedure
Avoid long strings in leapseconds.awk to work around a mawk bug.

View File

@@ -215,12 +215,12 @@ char * tzname[2] = {
static struct tm tm;
#ifdef USG_COMPAT
time_t timezone = 0;
long timezone = 0;
int daylight = 0;
#endif /* defined USG_COMPAT */
#ifdef ALTZONE
time_t altzone = 0;
long altzone = 0;
#endif /* defined ALTZONE */
static int_fast32_t

View File

@@ -492,7 +492,7 @@ label:
continue;
case 'z':
{
int diff;
long diff;
char const * sign;
if (t->tm_isdst < 0)