From 23f5bc220fc7892daae5b6444e69631623f206d6 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Thu, 3 Nov 2016 13:55:28 -0700 Subject: [PATCH] Fix build with MacOS 10.12 SDK Test: mmma -j system/media/audio_utils Change-Id: Iab8270c5f2dc011a984acd78f59a3adca73b7a62 --- audio_utils/fifo.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio_utils/fifo.cpp b/audio_utils/fifo.cpp index 9cdd48fd..fb489e27 100644 --- a/audio_utils/fifo.cpp +++ b/audio_utils/fifo.cpp @@ -50,9 +50,12 @@ int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *reques } #endif // __ANDROID__ #else // __linux__ -// macOS doesn't have clock_nanosleep +// macOS <10.12 doesn't have clockid_t / CLOCK_MONOTONIC +#ifndef CLOCK_MONOTONIC typedef int clockid_t; #define CLOCK_MONOTONIC 0 +#endif +// macOS doesn't have clock_nanosleep int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *request, struct timespec *remain) { -- 2.11.0