summaryrefslogtreecommitdiffstats
path: root/mdk-stage1/dietlibc/libugly/isleap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdk-stage1/dietlibc/libugly/isleap.c')
-rw-r--r--mdk-stage1/dietlibc/libugly/isleap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/libugly/isleap.c b/mdk-stage1/dietlibc/libugly/isleap.c
new file mode 100644
index 000000000..dcfa1ced6
--- /dev/null
+++ b/mdk-stage1/dietlibc/libugly/isleap.c
@@ -0,0 +1,6 @@
+int __isleap(int year) {
+ /* every fourth year is a leap year except for century years that are
+ * not divisible by 400. */
+/* return (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); */
+ return (!(year%4) && ((year%100) || !(year%400)));
+}