summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kujawa <kujo@insightfulengine.com>2019-01-04 20:18:25 -0500
committerJay Satiro <raysatiro@yahoo.com>2019-01-28 01:16:00 -0500
commitb0a43aade1c786f5c15d6a9fc478c7ae305d8db6 (patch)
treeb293c11abfbb608748efa92fe6e6e34201e82565
parent179311ec37ffed5b88f446f4348993a51a168abd (diff)
downloadcurl-b0a43aade1c786f5c15d6a9fc478c7ae305d8db6.tar.gz
timeval: Disable MSVC Analyzer GetTickCount warning
Compiling with msvc /analyze and a recent Windows SDK warns against using GetTickCount (Suggests to use GetTickCount64 instead.) Since GetTickCount is only being used when GetTickCount64 isn't available, I am disabling that warning. Fixes https://github.com/curl/curl/issues/3437 Closes https://github.com/curl/curl/pull/3440
-rw-r--r--lib/timeval.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/timeval.c b/lib/timeval.c
index f1cbfe677..2569f175c 100644
--- a/lib/timeval.c
+++ b/lib/timeval.c
@@ -47,7 +47,16 @@ struct curltime Curl_now(void)
(int)((count.QuadPart % freq.QuadPart) * 1000000 / freq.QuadPart);
}
else {
+ /* Disable /analyze warning that GetTickCount64 is preferred */
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:28159)
+#endif
DWORD milliseconds = GetTickCount();
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
now.tv_sec = milliseconds / 1000;
now.tv_usec = (milliseconds % 1000) * 1000;
}