From 059a9e8471e18a7e3093bbb0e32e3951c21aaefa Mon Sep 17 00:00:00 2001 From: skarg Date: Mon, 25 Jul 2011 03:27:26 +0000 Subject: [PATCH] Fixed compile error in module. --- bacnet-stack/ports/win32/timer.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/bacnet-stack/ports/win32/timer.c b/bacnet-stack/ports/win32/timer.c index 3fed6c29..d9ec41ad 100644 --- a/bacnet-stack/ports/win32/timer.c +++ b/bacnet-stack/ports/win32/timer.c @@ -54,7 +54,7 @@ static uint32_t Timer_Period = 1; * The resolution of _ftime() is 16 milliseconds * The only way to get microseconds accuracy is to use QueryPerformanceCounter *************************************************************************/ -#if 1 +#if 0 int gettimeofday( struct timeval *tp, void *tzp) @@ -62,17 +62,18 @@ int gettimeofday( /* QPC uses frequency and ticks */ LARGE_INTEGER tickPerSecond; LARGE_INTEGER tick; - time_t rawtime; + struct _timeb timebuffer; - time(&rawtime); + tzp = tzp; + _ftime(&timebuffer); QueryPerformanceFrequency(&tickPerSecond); QueryPerformanceCounter(&tick); - tv->tv_usec = (tick.QuadPart % tickPerSecond.QuadPart); - tp->tv_sec = (long)rawtime; + tp->tv_usec = (tick.QuadPart % tickPerSecond.QuadPart); + tp->tv_sec = timebuffer.time; return 0; } -#elif 0 +#elif 1 int gettimeofday( struct timeval *tp, void *tzp)