diff options
author | Nico Weber <thakis@chromium.org> | 2020-08-25 16:38:24 -0400 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-26 08:52:07 +0200 |
commit | 84ed2579594fdadef29ba145d8a7948ffe26200b (patch) | |
tree | 4a79cc738e8392253977fa1237e3f88aecbfe257 /AK/Time.h | |
parent | 394e4c04cd5dfdca56f67e6384288a209bdbf6dc (diff) | |
download | serenity-84ed2579594fdadef29ba145d8a7948ffe26200b.zip |
AK+LibC+LibCore+Kernel: Have fewer implementations of is_leap_year
Diffstat (limited to 'AK/Time.h')
-rw-r--r-- | AK/Time.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -28,6 +28,11 @@ namespace AK { +inline bool is_leap_year(int year) +{ + return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); +} + template<typename TimevalType> inline void timeval_sub(const TimevalType& a, const TimevalType& b, TimevalType& result) { @@ -146,6 +151,7 @@ inline bool operator!=(const TimespecType& a, const TimespecType& b) } +using AK::is_leap_year; using AK::timespec_add; using AK::timespec_add_timeval; using AK::timespec_sub; |