qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v13 2/7] net/vmnet: add vmnet backends to qapi/net


From: Christian Schoenebeck
Subject: Re: [PATCH v13 2/7] net/vmnet: add vmnet backends to qapi/net
Date: Mon, 24 Jan 2022 12:27:40 +0100

On Montag, 24. Januar 2022 10:56:00 CET Roman Bolshakov wrote:
> On Thu, Jan 13, 2022 at 08:22:14PM +0300, Vladislav Yaroshchuk wrote:
> > Create separate netdevs for each vmnet operating mode:
> > - vmnet-host
> > - vmnet-shared
> > - vmnet-bridged
> > 
> > Signed-off-by: Vladislav Yaroshchuk <yaroshchuk2000@gmail.com>
> > ---
> > 
> >  net/clients.h       |  11 ++++
> >  net/meson.build     |   7 +++
> >  net/net.c           |  10 ++++
> >  net/vmnet-bridged.m |  25 +++++++++
> >  net/vmnet-common.m  |  20 +++++++
> 
> Hi Vladislav,
> 
> It seems the last two files should have .c extension rather than .m.

I would not do that. Mind cross-compilers, please.

> Unlike Cocoa UI code, the files do not contain Objective-C classes. They are
> just C code with blocks (which is supported by compilers shipped with Xcode
> SDK), e.g this program can be compiled without extra compiler flags:
> 
> $ cat block.c
> int main() {
>         int (^x)(void) = ^{
>                 return 0;
>         };
> 
>         return x();
> }
> $ cc block.c && ./a.out
> $
> 
> Regards,
> Roman

Such blocks are still Objective-C language specific, they are not C and 
therefore won't work with GCC.

$ gcc block.c

block.c: In function ‘main’:
block.c:2:14: error: expected identifier or ‘(’ before ‘^’ token
         int (^x)(void) = ^{
              ^
block.c:6:16: warning: implicit declaration of function ‘x’ [-Wimplicit-
function-declaration]
         return x();
                ^
Best regards,
Christian Schoenebeck





reply via email to

[Prev in Thread] Current Thread [Next in Thread]