Make eina compile on OSX
authorhandyande <handyande>
Wed, 31 Dec 2008 11:51:37 +0000 (11:51 +0000)
committerhandyande <handyande@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Wed, 31 Dec 2008 11:51:37 +0000 (11:51 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@38382 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/include/eina_safety_checks.h
src/lib/eina_counter.c

index fac5a11..04c9da0 100644 (file)
@@ -298,6 +298,9 @@ case "${host_os}" in
    *bsd*)
       EINA_LIBS="${EINA_LIBS} -lrt -lm"
    ;;
+   *darwin*)
+      EINA_LIBS="${EINA_LIBS} -lm"
+   ;;
    *)
       EINA_LIBS="${EINA_LIBS} -ldl -lrt -lm"
    ;;
index 620eb20..13e53b3 100644 (file)
 #else /* no safety checks */
 
 #define EINA_SAFETY_ON_NULL_RETURN(exp)                                        \
-  do { (void)((exp) == NULL) } while (0)
+  do { (void)((exp) == NULL); } while (0)
 
 #define EINA_SAFETY_ON_NULL_RETURN_VAL(exp, val)                       \
   do { if (0 && (exp) == NULL) (void)val; } while (0)
 
 #define EINA_SAFETY_ON_TRUE_RETURN(exp)                                        \
-  do { (void)(exp) } while (0)
+  do { (void)(exp); } while (0)
 
 #define EINA_SAFETY_ON_TRUE_RETURN_VAL(exp, val)                       \
   do { if (0 && (exp)) (void)val; } while (0)
 
 #define EINA_SAFETY_ON_FALSE_RETURN(exp)                               \
-  do { (void)((!exp)) } while (0)
+  do { (void)((!exp)); } while (0)
 
 #define EINA_SAFETY_ON_FALSE_RETURN_VAL(exp, val)                      \
   do { if (0 && !(exp)) (void)val; } while (0)
index 992e818..3be46a5 100644 (file)
@@ -83,8 +83,10 @@ _eina_counter_time_get(Eina_Nano_Time *tp)
    return clock_gettime(CLOCK_PROCESS_CPUTIME_ID, tp);
 #elif defined(CLOCK_PROF)
    return clock_gettime(CLOCK_PROF, tp);
-#else
+#elif defined(CLOCK_REALTIME)
    return clock_gettime(CLOCK_REALTIME, tp);
+#else
+   return gettimeofday(tp, NULL);
 #endif
 }
 #else