From 5aa23eb8d6ae67c5a5e31737164307675b36518e Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Tue, 23 Apr 2013 15:27:23 +0100 Subject: Fix Windows build warnings. winsock2.h needs to be included before windows.h. Separate declarations and code. Signed-off-by: Jens Axboe --- os/windows/posix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'os/windows/posix.c') diff --git a/os/windows/posix.c b/os/windows/posix.c index 6a7841d5..794a707f 100755 --- a/os/windows/posix.c +++ b/os/windows/posix.c @@ -421,6 +421,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) { static LARGE_INTEGER freq = {{0,0}}; LARGE_INTEGER counts; + uint64_t t; QueryPerformanceCounter(&counts); if (freq.QuadPart == 0) @@ -429,7 +430,7 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) tp->tv_sec = counts.QuadPart / freq.QuadPart; /* Get the difference between the number of ns stored * in 'tv_sec' and that stored in 'counts' */ - uint64_t t = tp->tv_sec * freq.QuadPart; + t = tp->tv_sec * freq.QuadPart; t = counts.QuadPart - t; /* 't' now contains the number of cycles since the last second. * We want the number of nanoseconds, so multiply out by 1,000,000,000 -- cgit v1.2.3