fix windows build

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16966 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Mathieu Rene 2010-03-11 03:02:47 +00:00
parent a0891fa211
commit 936e0858cb
2 changed files with 12 additions and 6 deletions

View File

@ -43,7 +43,8 @@
#include <fcntl.h>
#include <errno.h>
#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 <windows.h>
#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;

View File

@ -798,6 +798,10 @@
RelativePath="..\..\src\switch_pcm.c"
>
</File>
<File
RelativePath="..\..\src\switch_profile.c"
>
</File>
<File
RelativePath="..\..\src\switch_regex.c"
>