diff --git a/src/timer/unix/SDL_systimer.c b/src/timer/unix/SDL_systimer.c index 0f96319af7..51bd0cf6c5 100644 --- a/src/timer/unix/SDL_systimer.c +++ b/src/timer/unix/SDL_systimer.c @@ -53,7 +53,9 @@ // Use CLOCK_MONOTONIC_RAW, if available, which is not subject to adjustment by NTP #ifdef HAVE_CLOCK_GETTIME -#ifdef CLOCK_MONOTONIC_RAW +// Older Android phones have a buggy CLOCK_MONOTONIC_RAW, use CLOCK_MONOTONIC +// See fix: https://github.com/torvalds/linux/commit/dbb236c1ceb697a559e0694ac4c9e7b9131d0b16 +#if defined(CLOCK_MONOTONIC_RAW) && !defined(__ANDROID__) #define SDL_MONOTONIC_CLOCK CLOCK_MONOTONIC_RAW #else #define SDL_MONOTONIC_CLOCK CLOCK_MONOTONIC