diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-11-16 17:27:44 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-11-16 17:30:17 +0000 |
commit | 4be80d5109a340973dc6ce0221ec5c5761587df0 (patch) | |
tree | d469b8fd5a9d3b70dd4dd1c85b0d63530b1e58af /lib/timeval.c | |
parent | 23e70e1cc65bf7491e78ab13331a141236b64775 (diff) | |
download | curl-4be80d5109a340973dc6ce0221ec5c5761587df0.tar.gz |
win32: Updated some legacy APIs to use the newer extended versions
Updated the usage of some legacy APIs, that are preventing curl from
compiling for Windows Store and Windows Phone build targets.
Suggested-by: Stefan Neis
Feature: http://sourceforge.net/p/curl/feature-requests/82/
Diffstat (limited to 'lib/timeval.c')
-rw-r--r-- | lib/timeval.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/timeval.c b/lib/timeval.c index 2fd720144..769eb3c49 100644 --- a/lib/timeval.c +++ b/lib/timeval.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -32,9 +32,17 @@ struct timeval curlx_tvnow(void) ** increases monotonically and wraps once 49.7 days have elapsed. */ struct timeval now; +#if !defined(_WIN32_WINNT) || !defined(_WIN32_WINNT_VISTA) || \ + (_WIN32_WINNT < _WIN32_WINNT_VISTA) DWORD milliseconds = GetTickCount(); now.tv_sec = milliseconds / 1000; now.tv_usec = (milliseconds % 1000) * 1000; +#else + ULONGLONG milliseconds = GetTickCount64(); + now.tv_sec = (long) (milliseconds / 1000); + now.tv_usec = (long) (milliseconds % 1000) * 1000; +#endif + return now; } |