summaryrefslogtreecommitdiff
path: root/AK/Time.h
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-05-28 13:48:06 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-05-28 13:48:06 +0200
commitcbd858544db7aa8307c4d686194df6cc814832af (patch)
tree8149ea9679bbebc945080ddfc1513169391b6d06 /AK/Time.h
parent16ea34fc12668c80e7fde25744d8cc75c99bb747 (diff)
downloadserenity-cbd858544db7aa8307c4d686194df6cc814832af.zip
LibC: Move struct timeval to sys/time.h. #POSIX
Diffstat (limited to 'AK/Time.h')
-rw-r--r--AK/Time.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/AK/Time.h b/AK/Time.h
index 3839f18f17..cab8ec54ba 100644
--- a/AK/Time.h
+++ b/AK/Time.h
@@ -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;