summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/timeval.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2019-03-27 17:53:10 +0300
committerdartraiden <wowemuh@gmail.com>2019-03-27 17:55:46 +0300
commite41e0c05795b60cd749ae038cd96c966ec0c87bb (patch)
treee1f0d837b021bcd1db9c59c3c56c09e1871d3750 /libs/libcurl/src/timeval.c
parent1634710bb1c4860feda7bb703fd01f5b2c23695d (diff)
libcurl: update to 7.64.1
Diffstat (limited to 'libs/libcurl/src/timeval.c')
-rw-r--r--libs/libcurl/src/timeval.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/libs/libcurl/src/timeval.c b/libs/libcurl/src/timeval.c
index 2569f175c3..ff8d8a69af 100644
--- a/libs/libcurl/src/timeval.c
+++ b/libs/libcurl/src/timeval.c
@@ -21,30 +21,22 @@
***************************************************************************/
#include "timeval.h"
-#include "system_win32.h"
#if defined(WIN32) && !defined(MSDOS)
+/* set in win32_init() */
+extern LARGE_INTEGER Curl_freq;
+extern bool Curl_isVistaOrGreater;
+
struct curltime Curl_now(void)
{
struct curltime now;
- static LARGE_INTEGER freq;
- static int isVistaOrGreater = -1;
- if(isVistaOrGreater == -1) {
- if(Curl_verify_windows_version(6, 0, PLATFORM_WINNT,
- VERSION_GREATER_THAN_EQUAL)) {
- isVistaOrGreater = 1;
- QueryPerformanceFrequency(&freq);
- }
- else
- isVistaOrGreater = 0;
- }
- if(isVistaOrGreater == 1) { /* QPC timer might have issues pre-Vista */
+ if(Curl_isVistaOrGreater) { /* QPC timer might have issues pre-Vista */
LARGE_INTEGER count;
QueryPerformanceCounter(&count);
- now.tv_sec = (time_t)(count.QuadPart / freq.QuadPart);
- now.tv_usec =
- (int)((count.QuadPart % freq.QuadPart) * 1000000 / freq.QuadPart);
+ now.tv_sec = (time_t)(count.QuadPart / Curl_freq.QuadPart);
+ now.tv_usec = (int)((count.QuadPart % Curl_freq.QuadPart) * 1000000 /
+ Curl_freq.QuadPart);
}
else {
/* Disable /analyze warning that GetTickCount64 is preferred */