1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:47:45 +00:00

AK+LibC+LibCore+Kernel: Have fewer implementations of is_leap_year

This commit is contained in:
Nico Weber 2020-08-25 16:38:24 -04:00 committed by Andreas Kling
parent 394e4c04cd
commit 84ed257959
4 changed files with 19 additions and 20 deletions

View file

@ -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;