qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Schoenebeck <qemu_oss@crudebyte.com>
To: qemu-devel@nongnu.org, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
Cc: Akihiko Odaki <akihiko.odaki@gmail.com>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [RFC PATCH 3/4] audio: Rename coreaudio extension to use Objective-C compiler
Date: Tue, 15 Feb 2022 14:37:56 +0100	[thread overview]
Message-ID: <3890080.xqXnxpx7Oq@silver> (raw)
In-Reply-To: <20220215120625.64711-4-f4bug@amsat.org>

On Dienstag, 15. Februar 2022 13:06:24 CET Philippe Mathieu-Daudé via wrote:
> The coreaudio library includes Objective-C declarations (using the
> caret '^' symbol to declare block references [*]). When building
> with a C compiler we get:
> 
>   [175/839] Compiling C object libcommon.fa.p/audio_coreaudio.c.o
>     In file included from
> /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Framew
> orks/CoreAudio.framework/Headers/CoreAudio.h:18, from
> ../../audio/coreaudio.c:26:
>    
> /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/System/Library/Framew
> orks/CoreAudio.framework/Headers/AudioHardware.h:162:2: error: expected
> identifier or '(' before '^' token 162 |
> (^AudioObjectPropertyListenerBlock)(    UInt32                             
> inNumberAddresses,
>           |  ^
> 
>     FAILED: libcommon.fa.p/audio_coreaudio.c.o
> 
> Rename the file to use the Objective-C default extension (.m) so
> meson calls the correct compiler.
> 
> [*]
> https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/
> ProgrammingWithObjectiveC/WorkingwithBlocks/WorkingwithBlocks.html
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

We already had a similar discussion before [1] whether to use .c and add
required compiler flags or using .m. I find this solution more appropriate.

Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>

[1] https://lore.kernel.org/all/7053351.4JHWUSIRgT@silver/

Best regards,
Christian Schoenebeck

>  audio/{coreaudio.c => coreaudio.m} | 0
>  audio/meson.build                  | 2 +-
>  2 files changed, 1 insertion(+), 1 deletion(-)
>  rename audio/{coreaudio.c => coreaudio.m} (100%)
> 
> diff --git a/audio/coreaudio.c b/audio/coreaudio.m
> similarity index 100%
> rename from audio/coreaudio.c
> rename to audio/coreaudio.m
> diff --git a/audio/meson.build b/audio/meson.build
> index d9b295514f..94dab16891 100644
> --- a/audio/meson.build
> +++ b/audio/meson.build
> @@ -7,7 +7,7 @@ softmmu_ss.add(files(
>    'wavcapture.c',
>  ))
> 
> -softmmu_ss.add(when: coreaudio, if_true: files('coreaudio.c'))
> +softmmu_ss.add(when: coreaudio, if_true: files('coreaudio.m'))
>  softmmu_ss.add(when: dsound, if_true: files('dsoundaudio.c',
> 'audio_win_int.c'))
> 
>  audio_modules = {}




  reply	other threads:[~2022-02-15 13:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 12:06 [RFC PATCH 0/4] buildsys: More fixes to use GCC on macOS Philippe Mathieu-Daudé via
2022-02-15 12:06 ` [RFC PATCH 1/4] osdep: Avoid using Clang-specific __builtin_available() Philippe Mathieu-Daudé via
2022-02-15 12:06 ` [PATCH 2/4] osdep: Un-inline qemu_thread_jit_execute/write Philippe Mathieu-Daudé via
2022-02-15 13:09   ` Akihiko Odaki
2022-02-15 13:29     ` Philippe Mathieu-Daudé via
2022-02-15 12:06 ` [RFC PATCH 3/4] audio: Rename coreaudio extension to use Objective-C compiler Philippe Mathieu-Daudé via
2022-02-15 13:37   ` Christian Schoenebeck [this message]
2022-02-15 12:06 ` [RFC PATCH 4/4] ui/cocoa: Ignore 'initializer overrides' warnings Philippe Mathieu-Daudé via
2022-02-15 12:34   ` Peter Maydell
2022-02-15 13:19     ` Akihiko Odaki
2022-02-15 13:23       ` Philippe Mathieu-Daudé via
2022-02-15 13:18   ` Christian Schoenebeck
2022-02-15 13:45     ` Peter Maydell
2022-02-15 14:06       ` Philippe Mathieu-Daudé via
2022-02-15 14:11       ` Christian Schoenebeck
2022-02-15 14:17         ` Peter Maydell
2022-02-15 13:06 ` [RFC PATCH 0/4] buildsys: More fixes to use GCC on macOS Akihiko Odaki
2022-02-15 13:25   ` Philippe Mathieu-Daudé via
2022-02-16  2:28     ` Akihiko Odaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3890080.xqXnxpx7Oq@silver \
    --to=qemu_oss@crudebyte.com \
    --cc=akihiko.odaki@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=r.bolshakov@yadro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).