diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2016-10-10 02:19:37 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2016-10-10 02:21:35 +0200 |
commit | 2fa2187e68d24648bf77780aaf72c5708681632d (patch) | |
tree | 389155c060a85d9be87f53288ae772957de390f5 /src/compat.h | |
parent | f2087f2da2752b84e000b42575bcc3abafbf57b4 (diff) | |
download | fastd-2fa2187e68d24648bf77780aaf72c5708681632d.tar fastd-2fa2187e68d24648bf77780aaf72c5708681632d.zip |
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.
Diffstat (limited to 'src/compat.h')
-rw-r--r-- | src/compat.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/compat.h b/src/compat.h index 0668ad9..5c71d1e 100644 --- a/src/compat.h +++ b/src/compat.h @@ -85,28 +85,3 @@ static inline char *get_current_dir_name(void) { } #endif - - -#ifdef __APPLE__ - -#include <mach/mach_time.h> - -#define CLOCK_MONOTONIC 0 -#define clockid_t int - -static inline int clock_gettime(clockid_t clk_id __attribute__((unused)), struct timespec *tp) { - static mach_timebase_info_data_t timebase_info = {}; - - if (!timebase_info.denom) - mach_timebase_info(&timebase_info); - - uint64_t time = (((long double)mach_absolute_time())*timebase_info.numer) / timebase_info.denom; - - tp->tv_sec = time / 1000000000; - tp->tv_nsec = time % 1000000000; - - return 0; -} - - -#endif |