From: Ravenlock <[EMAIL PROTECTED]>
Subject: Re: [E-devel] [PATCH] tiny patch eina for FreeBSD
Date: Mon, 27 Oct 2008 08:56:55 -0500
> On 10/26/2008 07:56, Joerg Sonnenberger wrote:
> > On Sat, Oct 25, 2008 at 01:18:25PM -0500, Ravenlock wrote:
> >>> eina build failed on FreeBSD, so I made FreeBSD patch.
> >> In SVN! :)
> >
> > Please invert that patch. CLOCK_PROF is mostly present, the alternative
> > not. E.g. linux clock if present, otherwise CLOCK_PROF or CLOCK_REALTIME
> > as last line of fallback.
>
> You prefer:
>
> #ifdef __linux__
> CLOCK_PROCESS_CPUTIME_ID
> #else
> CLOCK_PROF -or- CLOCK_REALTIME
> #endif
>
> because CLOCK_PROCESS_CPUTIME_ID is not implemented on *many* platforms,
> but known to linux?
>
I suggest:
#if defined(CLOCK_PROCESS_CPUTIME_ID) && defined(__linux__)
# define CLOCK CLOCK_PROCESS_CPUTIME_ID
#elif defined(CLOCK_PROF) && defined(__FreeBSD__)
# define CLOCK CLOCK_PROF
#else
# define CLOCK CLOCK_REALTIME
#endif
return clock_gettime(CLOCK, tp);
#undef CLOCK
Best regards.
-=-=-=-=-=-=-=-=-
Naruto TAKAHASHI
[EMAIL PROTECTED]
> >
> > Joerg
> >
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> > prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the world
> > http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > enlightenment-devel mailing list
> > enlightenment-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> >
> >
>
>
> --
> Regards,
> Ravenlock
>
>
Index: src/lib/eina_counter.c
===================================================================
--- src/lib/eina_counter.c (revision 37247)
+++ src/lib/eina_counter.c (working copy)
@@ -76,11 +76,15 @@
static inline int
_eina_counter_time_get(Eina_Nano_Time *tp)
{
-#ifdef __linux__
- return clock_gettime(CLOCK_PROCESS_CPUTIME_ID, tp);
+#if defined(CLOCK_PROCESS_CPUTIME_ID) && defined(__linux__)
+# define CLOCK CLOCK_PROCESS_CPUTIME_ID
+#elif defined(CLOCK_PROF) && defined(__FreeBSD__)
+# define CLOCK CLOCK_PROF
#else
- return clock_gettime(CLOCK_PROF, tp);
+# define CLOCK CLOCK_REALTIME
#endif
+ return clock_gettime(CLOCK, tp);
+#undef CLOCK
}
#else
static int EINA_COUNTER_ERROR_WINDOWS = 0;
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel