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

LibC: Move struct timeval to sys/time.h. #POSIX

This commit is contained in:
Andreas Kling 2019-05-28 13:48:06 +02:00
parent 16ea34fc12
commit cbd858544d
10 changed files with 42 additions and 34 deletions

View file

@ -2,7 +2,8 @@
namespace AK {
inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct timeval* result)
template<typename TimevalType>
inline void timeval_sub(const TimevalType* a, const TimevalType* b, TimevalType* result)
{
result->tv_sec = a->tv_sec - b->tv_sec;
result->tv_usec = a->tv_usec - b->tv_usec;
@ -12,7 +13,8 @@ inline void timeval_sub(const struct timeval* a, const struct timeval* b, struct
}
}
inline void timeval_add(const struct timeval* a, const struct timeval* b, struct timeval* result)
template<typename TimevalType>
inline void timeval_add(const TimevalType* a, const TimevalType* b, TimevalType* result)
{
result->tv_sec = a->tv_sec + b->tv_sec;
result->tv_usec = a->tv_usec + b->tv_usec;