From 3ed9d05c38dc9751cefbbee078f2847117573000 Mon Sep 17 00:00:00 2001 From: David Reid Date: Mon, 22 Jan 2024 07:26:38 +1000 Subject: [PATCH] Fix compilation error on Android. Public issue https://github.com/mackron/miniaudio/issues/805 --- miniaudio.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/miniaudio.h b/miniaudio.h index c1621aee..1cf6ad86 100644 --- a/miniaudio.h +++ b/miniaudio.h @@ -16169,7 +16169,11 @@ static ma_result ma_thread_create__posix(ma_thread* pThread, ma_thread_priority /* I'm not treating a failure of setting the priority as a critical error so not aborting on failure here. */ if (pthread_attr_setschedparam(&attr, &sched) == 0) { - pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + #if !defined(MA_ANDROID) || (defined(__ANDROID_API__) && __ANDROID_API__ >= 28) + { + pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); + } + #endif } } }