lib/rtc: Fix incomplete leap year macro

Signed-off-by: Jakub Czapiga <jacz@semihalf.com>
Found-by: Paul Fagerburg <pfagerburg@chromium.org>
Change-Id: Ic434c969141c67ce317a5db0c8805de02c84eb08
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52370
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
This commit is contained in:
Jakub Czapiga 2021-04-15 12:30:27 +02:00 committed by Paul Fagerburg
parent ac9af1adb9
commit 48b0079000
1 changed files with 1 additions and 1 deletions

View File

@ -11,7 +11,7 @@
#define STARTOFTIME 1970 #define STARTOFTIME 1970
#define SECDAY 86400L #define SECDAY 86400L
#define SECYR (SECDAY * 365) #define SECYR (SECDAY * 365)
#define LEAP_YEAR(year) ((year) % 4 == 0) #define LEAP_YEAR(year) (((year) % 4 == 0 && (year) % 100 != 0) || (year) % 400 == 0)
#define DAYS_IN_YEAR(a) (LEAP_YEAR(a) ? 366 : 365) #define DAYS_IN_YEAR(a) (LEAP_YEAR(a) ? 366 : 365)
#define DAYS_IN_MONTH(a) (month_days[(a) - 1]) #define DAYS_IN_MONTH(a) (month_days[(a) - 1])