Commit eaa3be9a authored by Jan Beich's avatar Jan Beich Committed by Jean-Baptiste Kempf

tools: mach_absolute_time is not portable, so stop checking at configure

parent b9a43c60
......@@ -44,7 +44,7 @@
#ifdef _WIN32
# include <windows.h>
#endif
#if defined(HAVE_MACH_ABSOLUTE_TIME)
#ifdef __APPLE__
#include <mach/mach_time.h>
#endif
......@@ -67,7 +67,7 @@ static uint64_t get_time_nanos(void) {
struct timespec ts;
clock_gettime(CLOCK_MONOTONIC, &ts);
return 1000000000ULL * ts.tv_sec + ts.tv_nsec;
#elif defined(HAVE_MACH_ABSOLUTE_TIME)
#elif defined(__APPLE__)
mach_timebase_info_data_t info;
mach_timebase_info(&info);
return mach_absolute_time() * info.numer / info.denom;
......
......@@ -73,8 +73,6 @@ rt_dependency = []
if host_machine.system() != 'windows'
if cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args)
cli_cdata.set('HAVE_CLOCK_GETTIME', 1)
elif host_machine.system() == 'darwin'
cli_cdata.set('HAVE_MACH_ABSOLUTE_TIME', 1)
else
rt_dependency = cc.find_library('rt', required: false)
if not cc.has_function('clock_gettime', prefix : '#include <time.h>', args : test_args, dependencies : rt_dependency)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment