From 7437c5022036b9d65e8076f90472fdf073fcd304 Mon Sep 17 00:00:00 2001 From: Daniel Jewell <23286051+danieldjewell@users.noreply.github.com> Date: Sat, 13 Jun 2020 15:10:30 -0700 Subject: [PATCH] Fix for r-lib/later#126 compilation on Android timespec_get is not available on Android's Bionic libc -- e.g. in sys/time.h ... This was raised as an issue in tinycthread/tinycthread#47 and this fix is based on @mcclure's commit https://github.com/mcclure/lovr/commit/c322ce2f04e56f6003a2798b5c8b79bf15641bcd ... see also android/ndk#864 --- src/tinycthread.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tinycthread.h b/src/tinycthread.h index e3903c48..66569a73 100644 --- a/src/tinycthread.h +++ b/src/tinycthread.h @@ -117,6 +117,10 @@ extern "C" { #define TTHREAD_NORETURN #endif +#ifdef __ANDROID__ +#undef TIME_UTC +#endif + /* If TIME_UTC is missing, provide it and provide a wrapper for timespec_get. */ #ifndef TIME_UTC