cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c56edbdf5311295a9ef3254d20d413389756425
commit 8c56edbdf5311295a9ef3254d20d413389756425 Author: pierre lamot <pierre.la...@openwide.fr> Date: Wed Jan 21 12:04:37 2015 +0100 eina: fix eina_test_rwlock test on OSX. add a reimplementation of clock_gettime for OSX within the test in order to be able to test eina_condition_timedwait Signed-off-by: Cedric BAIL <ced...@osg.samsung.com> --- src/tests/eina/eina_test_lock.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/tests/eina/eina_test_lock.c b/src/tests/eina/eina_test_lock.c index a149dea..02c6286 100644 --- a/src/tests/eina/eina_test_lock.c +++ b/src/tests/eina/eina_test_lock.c @@ -23,6 +23,24 @@ #include "eina_suite.h" #include "Eina.h" +#ifdef __MACH__ +# include <mach/clock.h> +# include <mach/mach.h> + +#define CLOCK_REALTIME 0 + +void clock_gettime(int mode, struct timespec* ts) +{ + clock_serv_t cclock; + mach_timespec_t mts; + host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock); + clock_get_time(cclock, &mts); + mach_port_deallocate(mach_task_self(), cclock); + ts->tv_sec = mts.tv_sec; + ts->tv_nsec = mts.tv_nsec; +} +#endif + static Eina_Spinlock spin; static Eina_Thread thread; static unsigned int counter; --