]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
does anything but windows and linux exist?
authorMichael Jerris <mike@jerris.com>
Fri, 12 Mar 2010 17:40:19 +0000 (17:40 +0000)
committerMichael Jerris <mike@jerris.com>
Fri, 12 Mar 2010 17:40:19 +0000 (17:40 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16976 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_profile.c

index 62d2e0162db52f9334b41bb401e0c87fae1a10f2..08c9cc044d00bef4130c52ee85dbe0c9f3c6878e 100644 (file)
 #include <sys/types.h>
 #include <fcntl.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
 
 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)