diff options
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 |