summaryrefslogtreecommitdiff
path: root/lib/timeval.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2019-07-31 15:30:31 +0200
committerDaniel Stenberg <daniel@haxx.se>2019-08-01 07:43:24 +0200
commitb1616dad8f088d873d88f88b4d884335a4ca285f (patch)
tree31637b618958b051693d23591042468243fe0b35 /lib/timeval.h
parent7c14dde9240a6a113358fe551f378328a41477e2 (diff)
downloadcurl-b1616dad8f088d873d88f88b4d884335a4ca285f.tar.gz
timediff: make it 64 bit (if possible) even with 32 bit time_t
... to make it hold microseconds too. Fixes #4165 Closes #4168
Diffstat (limited to 'lib/timeval.h')
-rw-r--r--lib/timeval.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/timeval.h b/lib/timeval.h
index 96867d713..53e063607 100644
--- a/lib/timeval.h
+++ b/lib/timeval.h
@@ -24,13 +24,13 @@
#include "curl_setup.h"
-#if SIZEOF_TIME_T < 8
-typedef int timediff_t;
-#define CURL_FORMAT_TIMEDIFF_T "d"
-#else
+/* Use a larger type even for 32 bit time_t systems so that we can keep
+ microsecond accuracy in it */
typedef curl_off_t timediff_t;
#define CURL_FORMAT_TIMEDIFF_T CURL_FORMAT_CURL_OFF_T
-#endif
+
+#define TIMEDIFF_T_MAX CURL_OFF_T_MAX
+#define TIMEDIFF_T_MIN CURL_OFF_T_MIN
struct curltime {
time_t tv_sec; /* seconds */