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:
parent
394e4c04cd
commit
84ed257959
4 changed files with 19 additions and 20 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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue