From ff28c036c301fbb98e49994c8091441b54c0ac7d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 26 Oct 2017 13:02:00 +0200 Subject: timeval: make timediff_t also work on 32bit windows ... by improving the typedef used. Reported-by: Gisle Vanem Bug: https://github.com/curl/curl/commit/b9d25f9a6b3ca791385b80a6a3c3fa5ae113e1e0#co mmitcomment-25205058 --- lib/timeval.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/timeval.h b/lib/timeval.h index 3821bfb73..b2878a634 100644 --- a/lib/timeval.h +++ b/lib/timeval.h @@ -27,7 +27,15 @@ #if SIZEOF_TIME_T < 8 typedef int timediff_t; #else -typedef ssize_t timediff_t; +/* use a suitable 64 bit type */ +#ifdef HAVE_LONGLONG +typedef long long timediff_t; +#elif defined(_MSC_VER) && (_MSC_VER >= 900) && (_INTEGRAL_MAX_BITS >= 64) +typedef __int64 timediff_t; +#else +/* hopeless case */ +typedef long timediff_t; +#endif #endif struct curltime { -- cgit v1.2.1