From 96d4b49b488d2cd77411918950f82acc21e674aa Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Fri, 12 Mar 2010 17:40:19 +0000 Subject: [PATCH] does anything but windows and linux exist? git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16976 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_profile.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/src/switch_profile.c b/src/switch_profile.c index 62d2e0162d..08c9cc044d 100644 --- a/src/switch_profile.c +++ b/src/switch_profile.c @@ -42,12 +42,6 @@ #include #include #include -#elif defined (MACOSX) || defined (DARWIN) - /* Unsupported */ -#else -/*already defined -#define _WIN32_WINNT 0x0501 // To make GetSystemTimes visible in windows.h*/ -#include #endif struct profile_timer @@ -73,12 +67,12 @@ struct profile_timer /* /proc/stat file descriptor used to retrieve the counters */ int procfd; int initd; -#elif defined (MACOSX) || defined (DARWIN) - /* Unsupported */ -#else +#elif defined (WIN32) || defined (WIN64) __int64 i64LastUserTime; __int64 i64LastKernelTime; __int64 i64LastIdleTime; +#else + /* Unsupported */ #endif }; @@ -136,9 +130,7 @@ static int read_cpu_stats(switch_profile_timer_t *p, } return 0; } -#endif -#ifdef __linux__ 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; @@ -199,14 +191,7 @@ SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, doubl return 0; } -#elif defined (MACOSX) || defined (DARWIN) - -SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage) -{ - return SWITCH_FALSE; -} - -#else +#elif defined (WIN32) || defined (WIN64) 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; } +#else + + /* Unsupported */ +SWITCH_DECLARE(int) switch_get_system_idle_time(switch_profile_timer_t *p, double *idle_percentage) +{ + return SWITCH_FALSE; +} + #endif SWITCH_DECLARE(switch_profile_timer_t *)switch_new_profile_timer(void)