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 <yaroshchuk2...@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