Commit 1964144a authored by David Reid's avatar David Reid Committed by GitHub

Merge pull request #373 from orx/dev-0.11

Fixed compiling for iOS 11.x and earlier
parents eccbbdd0 8e092f37
...@@ -31556,7 +31556,7 @@ static ma_result ma_context_uninit__coreaudio(ma_context* pContext) ...@@ -31556,7 +31556,7 @@ static ma_result ma_context_uninit__coreaudio(ma_context* pContext)
return MA_SUCCESS; return MA_SUCCESS;
} }
#if defined(MA_APPLE_MOBILE) #if defined(MA_APPLE_MOBILE) && defined(__IPHONE_12_0)
static AVAudioSessionCategory ma_to_AVAudioSessionCategory(ma_ios_session_category category) static AVAudioSessionCategory ma_to_AVAudioSessionCategory(ma_ios_session_category category)
{ {
/* The "default" and "none" categories are treated different and should not be used as an input into this function. */ /* The "default" and "none" categories are treated different and should not be used as an input into this function. */
...@@ -31613,9 +31613,13 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte ...@@ -31613,9 +31613,13 @@ static ma_result ma_context_init__coreaudio(ma_context* pContext, const ma_conte
} }
} else { } else {
if (pConfig->coreaudio.sessionCategory != ma_ios_session_category_none) { if (pConfig->coreaudio.sessionCategory != ma_ios_session_category_none) {
#if defined(__IPHONE_12_0)
if (![pAudioSession setCategory: ma_to_AVAudioSessionCategory(pConfig->coreaudio.sessionCategory) withOptions:options error:nil]) { if (![pAudioSession setCategory: ma_to_AVAudioSessionCategory(pConfig->coreaudio.sessionCategory) withOptions:options error:nil]) {
return MA_INVALID_OPERATION; /* Failed to set session category. */ return MA_INVALID_OPERATION; /* Failed to set session category. */
} }
#else
return MA_INVALID_OPERATION; /* AVAudioSession.Category was introduced in iOS 12.0. */
#endif
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment