From db0691d2362465720845a16d3ec96c1e60359893 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 27 Jun 2021 08:24:59 -0600 Subject: [PATCH] macOS: fix compilation warnings on macOS versions where clock_gettime() is finally implemented --- libs/pbd/microseconds.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/pbd/microseconds.cc b/libs/pbd/microseconds.cc index 49d91c253f..462a3054f6 100644 --- a/libs/pbd/microseconds.cc +++ b/libs/pbd/microseconds.cc @@ -38,9 +38,10 @@ static double timer_rate_usecs = 0.0; */ #ifdef __MACH__ +#include +#ifndef CLOCK_REALTIME /* Thanks Apple for not implementing this basic SUSv2, POSIX.1-2001 function */ -#include #define CLOCK_REALTIME 0 #define CLOCK_MONOTONIC 0 int @@ -61,6 +62,7 @@ clock_gettime (int /*clk_id*/, struct timespec* t) return 0; } #endif +#endif void PBD::microsecond_timer_init ()