Since CLOCK_PROCESS_CPUTIME_ID is a POSIX standard, we use it if it
authorenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 27 Oct 2008 15:16:06 +0000 (15:16 +0000)
committerenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 27 Oct 2008 15:16:06 +0000 (15:16 +0000)
exists regardles of system. Seems BSD actually is the weird case here.
Still use CLOCK_REALTIME as fallback.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@37249 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/eina_counter.c

index 1b16a6b..d895555 100644 (file)
@@ -76,12 +76,12 @@ static int _eina_counter_init_count = 0;
 static inline int
 _eina_counter_time_get(Eina_Nano_Time *tp)
 {
-#if defined (__linux__) && defined(CLOCK_PROCESS_CPUTIME_ID)
+#if defined(CLOCK_PROCESS_CPUTIME_ID)
    return clock_gettime(CLOCK_PROCESS_CPUTIME_ID, tp);
-#elif defined(__FreeBSD__) && defined(CLOCK_PROF)
+#elif defined(CLOCK_PROF)
    return clock_gettime(CLOCK_PROF, tp);
 #else
-   return clock_gettime(CLOCK, tp);
+   return clock_gettime(CLOCK_REALTIME, tp);
 #endif
 }
 #else