ref: eaa3be9a841943389f43991c3edabde54f62350f
parent: b9a43c60954a5ca338febf252a1abbed2cd9e4d0
author: Jan Beich <jbeich@FreeBSD.org>
date: Fri Nov 22 17:05:44 EST 2019
tools: mach_absolute_time is not portable, so stop checking at configure
--- a/tools/dav1d.c
+++ b/tools/dav1d.c
@@ -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 @@
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;
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -73,8 +73,6 @@
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)