Module Name:    src
Committed By:   kre
Date:           Tue Sep 17 09:55:38 UTC 2024

Modified Files:
        src/bin/date: date.c

Log Message:
isleap() is not a standard function/macro, so if none of the include
files have defined a macro of that name, define it ourselves.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/bin/date/date.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/bin/date/date.c
diff -u src/bin/date/date.c:1.66 src/bin/date/date.c:1.67
--- src/bin/date/date.c:1.66	Sun Jan 21 16:55:56 2024
+++ src/bin/date/date.c	Tue Sep 17 09:55:38 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: date.c,v 1.66 2024/01/21 16:55:56 christos Exp $ */
+/* $NetBSD: date.c,v 1.67 2024/09/17 09:55:38 kre Exp $ */
 
 /*
  * Copyright (c) 1985, 1987, 1988, 1993
@@ -44,7 +44,7 @@ __COPYRIGHT(
 #if 0
 static char sccsid[] = "@(#)date.c	8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: date.c,v 1.66 2024/01/21 16:55:56 christos Exp $");
+__RCSID("$NetBSD: date.c,v 1.67 2024/09/17 09:55:38 kre Exp $");
 #endif
 #endif /* not lint */
 
@@ -78,6 +78,10 @@ __dead static void badcanotime(const cha
 static void setthetime(const char *);
 __dead static void usage(void);
 
+#if !defined(isleap)
+# define isleap(y)   (((y) % 4) == 0 && (((y) % 100) != 0 || ((y) % 400) == 0))
+#endif
+
 int
 main(int argc, char *argv[])
 {

Reply via email to