summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean@guyomarch.bzh>2016-10-01 17:32:13 +0200
committerJean Guyomarc'h <jean@guyomarch.bzh>2016-10-01 21:09:10 +0200
commitb39da38aa018d49b1eb0eefcfc599396f64dcaad (patch)
tree4ddb2a3dacae0de5fd72e47d875be8fcb6d40688
parenta0f9393dbbea9d5edda583fef11e2be31d7686e6 (diff)
tests: check for the presence of clock_gettime()
macOS Sierra provides clock_gettime(). Instead of testing for the Mach kernel to re-implement clock_gettime(), let first check that clock_gettime() is not already declared. Older OSX versions will have the Mach-only fallback. @fix
-rw-r--r--src/default.profrawbin0 -> 10872 bytes
-rw-r--r--src/tests/eina/eina_test_lock.c16
2 files changed, 11 insertions, 5 deletions
diff --git a/src/default.profraw b/src/default.profraw
new file mode 100644
index 0000000000..bffe4ba5b8
--- /dev/null
+++ b/src/default.profraw
Binary files differ
diff --git a/src/tests/eina/eina_test_lock.c b/src/tests/eina/eina_test_lock.c
index 02d5810a63..101d73c2da 100644
--- a/src/tests/eina/eina_test_lock.c
+++ b/src/tests/eina/eina_test_lock.c
@@ -26,11 +26,13 @@
26 26
27#include "eina_suite.h" 27#include "eina_suite.h"
28 28
29#ifdef __MACH__ 29#ifndef HAVE_CLOCK_GETTIME
30# include <mach/clock.h>
31# include <mach/mach.h>
32 30
33#define CLOCK_REALTIME 0 31# ifdef __MACH__
32# include <mach/clock.h>
33# include <mach/mach.h>
34
35# define CLOCK_REALTIME 0
34 36
35int 37int
36clock_gettime(int mode, struct timespec* ts) 38clock_gettime(int mode, struct timespec* ts)
@@ -51,7 +53,11 @@ clock_gettime(int mode, struct timespec* ts)
51 53
52 return 0; 54 return 0;
53} 55}
54#endif 56# else /* ! __MACH__ */
57# error No support for clock_gettime()
58# endif /* __MACH__ *//
59
60#endif /* ! HAVE_CLOCK_GETTIME */
55 61
56static Eina_Spinlock spin; 62static Eina_Spinlock spin;
57static Eina_Thread thread; 63static Eina_Thread thread;