aboutsummaryrefslogtreecommitdiff
path: root/lib/timeval.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-07-28 15:49:36 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-07-28 15:51:25 +0200
commit4dee50b9c80f9b18d2eb9a1c20bd879abb342302 (patch)
tree7a9c5ddd299e23ad27c7efa6a8759ae3122f31c9 /lib/timeval.h
parent7551e55d6614cddb039602e08f3d7aa302299617 (diff)
timeval: struct curltime is a struct timeval replacement
... to make all libcurl internals able to use the same data types for the struct members. The timeval struct differs subtly on several platforms so it makes it cumbersome to use everywhere. Ref: #1652 Closes #1693
Diffstat (limited to 'lib/timeval.h')
-rw-r--r--lib/timeval.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/timeval.h b/lib/timeval.h
index 9217018a8..1ee4b3044 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -29,7 +29,12 @@
#include "curl_setup.h"
-struct timeval curlx_tvnow(void);
+struct curltime {
+ time_t tv_sec; /* seconds */
+ unsigned int tv_usec; /* microseconds */
+};
+
+struct curltime curlx_tvnow(void);
/*
* Make sure that the first argument (t1) is the more recent time and t2 is
@@ -37,7 +42,7 @@ struct timeval curlx_tvnow(void);
*
* Returns: the time difference in number of milliseconds.
*/
-time_t curlx_tvdiff(struct timeval t1, struct timeval t2);
+time_t curlx_tvdiff(struct curltime t1, struct curltime t2);
/*
* Make sure that the first argument (t1) is the more recent time and t2 is
@@ -45,7 +50,7 @@ time_t curlx_tvdiff(struct timeval t1, struct timeval t2);
*
* Returns: the time difference in number of microseconds.
*/
-time_t Curl_tvdiff_us(struct timeval newer, struct timeval older);
+time_t Curl_tvdiff_us(struct curltime newer, struct curltime older);
/* These two defines below exist to provide the older API for library
internals only. */