does anything but windows and linux exist?

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16976 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2010-03-12 17:40:19 +00:00
parent 4fd5da2dc4
commit 96d4b49b48

View File

@ -42,12 +42,6 @@
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#elif defined (MACOSX) || defined (DARWIN)
/* Unsupported */
#else
/*already defined
#define _WIN32_WINNT 0x0501 // To make GetSystemTimes visible in windows.h*/
#include <windows.h>
#endif #endif
struct profile_timer struct profile_timer
@ -73,12 +67,12 @@ struct profile_timer
/* /proc/stat file descriptor used to retrieve the counters */ /* /proc/stat file descriptor used to retrieve the counters */
int procfd; int procfd;
int initd; int initd;
#elif defined (MACOSX) || defined (DARWIN) #elif defined (WIN32) || defined (WIN64)
/* Unsupported */
#else
__int64 i64LastUserTime; __int64 i64LastUserTime;
__int64 i64LastKernelTime; __int64 i64LastKernelTime;
__int64 i64LastIdleTime; __int64 i64LastIdleTime;
#else
/* Unsupported */
#endif #endif
}; };
@ -136,9 +130,7 @@ static int read_cpu_stats(switch_profile_timer_t *p,
} }
return 0; return 0;
} }
#endif
#ifdef __linux__
SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage) SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage)
{ {
unsigned long long user, nice, system, idle, iowait, irq, softirq, steal; unsigned long long user, nice, system, idle, iowait, irq, softirq, steal;
@ -199,14 +191,7 @@ SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, doubl
return 0; return 0;
} }
#elif defined (MACOSX) || defined (DARWIN) #elif defined (WIN32) || defined (WIN64)
SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage)
{
return SWITCH_FALSE;
}
#else
SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage) SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage)
{ {
@ -245,6 +230,14 @@ SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, doubl
return 0; return 0;
} }
#else
/* Unsupported */
SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage)
{
return SWITCH_FALSE;
}
#endif #endif
SWITCH_DECLARE(switch_profile_timer_t *)switch_new_profile_timer(void) SWITCH_DECLARE(switch_profile_timer_t *)switch_new_profile_timer(void)