aboutsummaryrefslogtreecommitdiff
path: root/timezone/tzfile.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-01-26 00:01:20 +0000
committerUlrich Drepper <drepper@redhat.com>2005-01-26 00:01:20 +0000
commit792dcd77cdafb46c746119e250a5ba9d20598f8f (patch)
treebb604fb38044db5ee084d94996775399ac3de2ab /timezone/tzfile.h
parent1f25bddd621e1cad0d655ea9cedf3a718d6fdabb (diff)
downloadglibc-792dcd77cdafb46c746119e250a5ba9d20598f8f.zip
glibc-792dcd77cdafb46c746119e250a5ba9d20598f8f.tar.gz
glibc-792dcd77cdafb46c746119e250a5ba9d20598f8f.tar.bz2
Update.
2005-01-25 Jakub Jelinek <jakub@redhat.com> * stdlib/fmtmsg.c (addseverity): Remove new_string variable. (free_mem): Don't free string. * stdlib/tst-fmtmsg.c: Include string.h. (main): Add some more tests. 2005-01-25 Andreas Schwab <schwab@suse.de> * timezone/asia: Update from tzdata2005c. * timezone/backward: Likewise. * timezone/leapseconds: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * timezone/private.h: Update from tzcode2005c. * timezone/tzfile.h: Likewise. * timezone/zdump.c: Likewise. * timezone/zic.c: Likewise.
Diffstat (limited to 'timezone/tzfile.h')
-rw-r--r--timezone/tzfile.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/timezone/tzfile.h b/timezone/tzfile.h
index 0921c3c..0e9966a 100644
--- a/timezone/tzfile.h
+++ b/timezone/tzfile.h
@@ -21,7 +21,7 @@
#ifndef lint
#ifndef NOID
-static char tzfilehid[] = "@(#)tzfile.h 7.14";
+static char tzfilehid[] = "@(#)tzfile.h 7.16";
#endif /* !defined NOID */
#endif /* !defined lint */
@@ -156,12 +156,21 @@ struct tzhead {
#define EPOCH_YEAR 1970
#define EPOCH_WDAY TM_THURSDAY
+#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
+
/*
-** Accurate only for the past couple of centuries;
-** that will probably do.
+** Since everything in isleap is modulo 400 (or a factor of 400), we know that
+** isleap(y) == isleap(y % 400)
+** and so
+** isleap(a + b) == isleap((a + b) % 400)
+** or
+** isleap(a + b) == isleap(a % 400 + b % 400)
+** 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.
*/
-#define isleap(y) (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
+#define isleap_sum(a, b) isleap((a) % 400 + (b) % 400)
#ifndef USG