From 2fa2187e68d24648bf77780aaf72c5708681632d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 10 Oct 2016 02:19:37 +0200 Subject: time, compat: don't redefine clock_gettime on MacOS MacOS X 10.12 has intruduced a clock_gettime function. Use an own function name instead. --- src/fastd.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/fastd.h') diff --git a/src/fastd.h b/src/fastd.h index 1206cd8..88adbf9 100644 --- a/src/fastd.h +++ b/src/fastd.h @@ -379,6 +379,7 @@ void fastd_iface_write(fastd_iface_t *iface, fastd_buffer_t buffer); void fastd_iface_close(fastd_iface_t *iface); void fastd_random_bytes(void *buffer, size_t len, bool secure); +int64_t fastd_get_time(void); #ifdef __ANDROID__ @@ -558,10 +559,7 @@ static inline void fastd_timeout_advance(fastd_timeout_t *a, fastd_timeout_t v) /** Updates the current time */ static inline void fastd_update_time(void) { - struct timespec ts; - clock_gettime(CLOCK_MONOTONIC, &ts); - - ctx.now = (1000*(int64_t)ts.tv_sec) + ts.tv_nsec/1000000; + ctx.now = fastd_get_time(); } /** Checks if a on-verify command is set */ -- cgit v1.2.3