From 936e0858cb586167aa79dd2c9937e7cf40b1e37a Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Thu, 11 Mar 2010 03:02:47 +0000 Subject: [PATCH] fix windows build git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16966 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_profile.c | 14 ++++++++------ w32/Library/FreeSwitchCore.2008.vcproj | 4 ++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/switch_profile.c b/src/switch_profile.c index 056511e763..7e4e9e532b 100644 --- a/src/switch_profile.c +++ b/src/switch_profile.c @@ -43,7 +43,8 @@ #include #include #else -#define _WIN32_WINNT 0x0501 // To make GetSystemTimes visible in windows.h +/*already defined +#define _WIN32_WINNT 0x0501 // To make GetSystemTimes visible in windows.h*/ #include #endif @@ -201,16 +202,17 @@ SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, doubl FILETIME idleTime; FILETIME kernelTime; FILETIME userTime; + __int64 i64UserTime, i64KernelTime, i64IdleTime; - if (!::GetSystemTimes(&idleTime, &kernelTime, &userTime)) { - return false; + if (!GetSystemTimes(&idleTime, &kernelTime, &userTime)) { + return SWITCH_FALSE; } - __int64 i64UserTime = (__int64)userTime.dwLowDateTime | ((__int64)userTime.dwHighDateTime << 32); + i64UserTime = (__int64)userTime.dwLowDateTime | ((__int64)userTime.dwHighDateTime << 32); - __int64 i64KernelTime = (__int64)kernelTime.dwLowDateTime | ((__int64)kernelTime.dwHighDateTime << 32); + i64KernelTime = (__int64)kernelTime.dwLowDateTime | ((__int64)kernelTime.dwHighDateTime << 32); - __int64 i64IdleTime = (__int64)idleTime.dwLowDateTime | ((__int64)idleTime.dwHighDateTime << 32); + i64IdleTime = (__int64)idleTime.dwLowDateTime | ((__int64)idleTime.dwHighDateTime << 32); if (p->valid_last_times) { __int64 i64User = i64UserTime - p->i64LastUserTime; diff --git a/w32/Library/FreeSwitchCore.2008.vcproj b/w32/Library/FreeSwitchCore.2008.vcproj index 1db126677e..4bd5eb7ea5 100644 --- a/w32/Library/FreeSwitchCore.2008.vcproj +++ b/w32/Library/FreeSwitchCore.2008.vcproj @@ -798,6 +798,10 @@ RelativePath="..\..\src\switch_pcm.c" > + +