Fix: Audaspace: Unsupported availability guard

`__builtin_available` needs to be used with `if()`

Pull Request: https://projects.blender.org/blender/blender/pulls/135161
This commit is contained in:
Weizhen Huang
2025-02-26 11:58:27 +01:00
committed by Gitea
parent 63e6f53ba0
commit f116329cab

View File

@@ -148,14 +148,12 @@ void CoreAudioDevice::open()
void CoreAudioDevice::close()
{
// NOTE: Keep the device open for buggy MacOS versions (see blender issue #121911).
if(!__builtin_available(macOS 15.2, *))
if(__builtin_available(macOS 15.2, *))
{
return;
AudioOutputUnitStop(m_audio_unit);
AudioUnitUninitialize(m_audio_unit);
AudioComponentInstanceDispose(m_audio_unit);
}
AudioOutputUnitStop(m_audio_unit);
AudioUnitUninitialize(m_audio_unit);
AudioComponentInstanceDispose(m_audio_unit);
}
CoreAudioDevice::CoreAudioDevice(DeviceSpecs specs, int buffersize) :