diff options
author | Curl Upstream <curl-library@cool.haxx.se> | 2018-01-23 21:49:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-01-24 19:14:23 (GMT) |
commit | af9e654045f11028e50dac4781e297834129a749 (patch) | |
tree | 028fac729d317112e5790204712f4b4c7985a0de /lib/timeval.h | |
parent | de7c21d677db1ddaeece03c19e13e448f4031511 (diff) | |
download | CMake-af9e654045f11028e50dac4781e297834129a749.zip CMake-af9e654045f11028e50dac4781e297834129a749.tar.gz CMake-af9e654045f11028e50dac4781e297834129a749.tar.bz2 |
curl 2018-01-23 (d6c21c8e)
Code extracted from:
https://github.com/curl/curl.git
at commit d6c21c8eec597a925d2b647cff3d58ac69de01a0 (curl-7_58_0).
Diffstat (limited to 'lib/timeval.h')
-rw-r--r-- | lib/timeval.h | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/timeval.h b/lib/timeval.h index 1ee4b30..fb3f680 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -22,19 +22,20 @@ * ***************************************************************************/ -/* - * CAUTION: this header is designed to work when included by the app-side - * as well as the library. Do not mix with library internals! - */ - #include "curl_setup.h" +#if SIZEOF_TIME_T < 8 +typedef int timediff_t; +#else +typedef curl_off_t timediff_t; +#endif + struct curltime { - time_t tv_sec; /* seconds */ - unsigned int tv_usec; /* microseconds */ + time_t tv_sec; /* seconds */ + int tv_usec; /* microseconds */ }; -struct curltime curlx_tvnow(void); +struct curltime Curl_now(void); /* * Make sure that the first argument (t1) is the more recent time and t2 is @@ -42,7 +43,7 @@ struct curltime curlx_tvnow(void); * * Returns: the time difference in number of milliseconds. */ -time_t curlx_tvdiff(struct curltime t1, struct curltime t2); +timediff_t Curl_timediff(struct curltime t1, struct curltime t2); /* * Make sure that the first argument (t1) is the more recent time and t2 is @@ -50,12 +51,6 @@ time_t curlx_tvdiff(struct curltime t1, struct curltime t2); * * Returns: the time difference in number of microseconds. */ -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. */ -#define Curl_tvnow() curlx_tvnow() -#define Curl_tvdiff(x,y) curlx_tvdiff(x,y) +timediff_t Curl_timediff_us(struct curltime newer, struct curltime older); #endif /* HEADER_CURL_TIMEVAL_H */ - |