mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-11-24 00:48:41 +00:00
SCCS-file: tzfile.h
SCCS-SID: 7.16
This commit is contained in:
committed by
Paul Eggert
parent
453ed380ef
commit
e86c95c46e
13
tzfile.h
13
tzfile.h
@ -156,14 +156,6 @@ struct tzhead {
|
|||||||
#define EPOCH_YEAR 1970
|
#define EPOCH_YEAR 1970
|
||||||
#define EPOCH_WDAY TM_THURSDAY
|
#define EPOCH_WDAY TM_THURSDAY
|
||||||
|
|
||||||
/*
|
|
||||||
** Given an integral argument (a) and a positive integral argument (b),
|
|
||||||
** return a % b per C99.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define C99IPMOD(a, b) ((-1 % 2 < 0 || (a) >= 0) ? \
|
|
||||||
((a) % (b)) : ((a) % (b) - (b)))
|
|
||||||
|
|
||||||
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
|
#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -173,11 +165,12 @@ struct tzhead {
|
|||||||
** isleap(a + b) == isleap((a + b) % 400)
|
** isleap(a + b) == isleap((a + b) % 400)
|
||||||
** or
|
** or
|
||||||
** isleap(a + b) == isleap(a % 400 + b % 400)
|
** isleap(a + b) == isleap(a % 400 + b % 400)
|
||||||
** (at least under the C99 definition of %).
|
** This is true even if % means modulo rather than Fortran remainder
|
||||||
|
** (which is allowed by C89 but not C99).
|
||||||
** We use this to avoid addition overflow problems.
|
** We use this to avoid addition overflow problems.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define isleap_sum(a, b) isleap(C99IPMOD((a), 400) + C99IPMOD((b), 400))
|
#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
|
||||||
|
|
||||||
#ifndef USG
|
#ifndef USG
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user