OSDN Git Service

Add macro that checks whether year is leap.
authorrelan <relan@users.noreply.github.com>
Fri, 2 Oct 2009 16:15:31 +0000 (16:15 +0000)
committerrelan <relan@users.noreply.github.com>
Mon, 24 Aug 2015 05:26:10 +0000 (08:26 +0300)
Only XX and XXI centuries are considered, so the check is simplified.

libexfat/utils.c

index 9fef909..f079f86 100644 (file)
@@ -110,6 +110,8 @@ void exfat_stat(const struct exfat_node* node, struct stat *stbuf)
    (excluding the specified year itself) */
 #define LEAP_YEARS(year) ((EXFAT_EPOCH_YEAR + (year) - 1) / 4 \
                - (EXFAT_EPOCH_YEAR - 1) / 4)
+/* checks whether the specified year is leap */
+#define IS_LEAP_YEAR(year) ((EXFAT_EPOCH_YEAR + (year)) % 4 == 0)
 
 static const time_t days_in_year[] =
 {