[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12 |
Date: |
Mon, 10 Jan 2022 09:44:13 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 |
On 1/10/22 09:17, Akihiko Odaki wrote:
> On 2022/01/10 2:06, Philippe Mathieu-Daudé wrote:
>> When building on macOS 12 we get:
>>
>> audio/coreaudio.c:50:5: error: 'kAudioObjectPropertyElementMaster'
>> is deprecated: first deprecated in macOS 12.0
>> [-Werror,-Wdeprecated-declarations]
>> kAudioObjectPropertyElementMaster
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> kAudioObjectPropertyElementMain
>>
>> /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:208:5:
>> note: 'kAudioObjectPropertyElementMaster' has been explicitly marked
>> deprecated here
>> kAudioObjectPropertyElementMaster
>> API_DEPRECATED_WITH_REPLACEMENT("kAudioObjectPropertyElementMain",
>> macos(10.0, 12.0), ios(2.0, 15.0), watchos(1.0, 8.0), tvos(9.0, 15.0))
>> = kAudioObjectPropertyElementMain
>> ^
>>
>> Use kAudioObjectPropertyElementMain (define it to
>> kAudioObjectPropertyElementMaster on macOS < 12).
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>> audio/coreaudio.c | 16 ++++++++++------
>> 1 file changed, 10 insertions(+), 6 deletions(-)
>>
>> diff --git a/audio/coreaudio.c b/audio/coreaudio.c
>> index d8a21d3e507..c836bc9dd37 100644
>> --- a/audio/coreaudio.c
>> +++ b/audio/coreaudio.c
>> @@ -44,10 +44,14 @@ typedef struct coreaudioVoiceOut {
>> bool enabled;
>> } coreaudioVoiceOut;
>> +#if !defined(MAC_OS_VERSION_12_0)
>> +#define kAudioObjectPropertyElementMain
>> kAudioObjectPropertyElementMaster
>> +#endif
>> +
>
> Semantically MAC_OS_VERSION_12_0 defines the numeric value of version
> 12.0 and its existence does not mean that
> kAudioObjectPropertyElementMain is defined. I suggest the following:
> #if !__is_identifier(kAudioObjectPropertyElementMain)
> #define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
> #endif
OK, thank you!
> Regards,
> Akihiko Odaki
- [RFC PATCH v2 0/6] host: Support macOS 12, Philippe Mathieu-Daudé, 2022/01/09
- [PATCH v2 1/6] configure: Allow passing extra Objective C compiler flags, Philippe Mathieu-Daudé, 2022/01/09
- [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/01/09
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Akihiko Odaki, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12,
Philippe Mathieu-Daudé <=
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Christian Schoenebeck, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Philippe Mathieu-Daudé, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Peter Maydell, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Akihiko Odaki, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Christian Schoenebeck, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Akihiko Odaki, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Peter Maydell, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Christian Schoenebeck, 2022/01/10
- Re: [RFC PATCH v2 2/6] audio/coreaudio: Remove a deprecation warning on macOS 12, Akihiko Odaki, 2022/01/10