AC_SUBST(rt_libs)
if test -n "$rt_libs"; then
- _bkp_LIBS="$LIBS"
- LIBS="$LIBS $rt_libs"
- AC_CHECK_FUNCS(clock_gettime)
- LIBS="$_bkp_LIBS"
- unset _bkp_LIBS
+ AC_DEFINE(HAVE_CLOCK_GETTIME, [1], [Have clock_gettime()])
fi
# Eina library
#include <time.h>
-#if HAVE_CLOCK_GETTIME
+#ifdef HAVE_CLOCK_GETTIME
static clockid_t _ecore_time_clock_id = -1;
-#else
-static int _ecore_time_clock_id = -1;
#endif
double _ecore_time_loop_time = -1.0;
EAPI double
ecore_time_get(void)
{
-#if !HAVE_CLOCK_GETTIME
- return ecore_time_unix_get();
-#else
+#ifdef HAVE_CLOCK_GETTIME
struct timespec t;
if (EINA_UNLIKELY(_ecore_time_clock_id < 0))
}
return (double)t.tv_sec + (((double)t.tv_nsec) / 1000000000.0);
+#else
+ return ecore_time_unix_get();
#endif
}
void
_ecore_time_init(void)
{
-#if HAVE_CLOCK_GETTIME
+#ifdef HAVE_CLOCK_GETTIME
struct timespec t;
if (_ecore_time_clock_id != -1) return;
}
#else
# warning "Your platform isn't supported yet"
- _ecore_time_clock_id = -2;
CRIT("Platform does not support clock_gettime. "
"Fallback to unix time.");
#endif