Re: How does the Swift Darwin module work?
Re: How does the Swift Darwin module work?
- Subject: Re: How does the Swift Darwin module work?
- From: Jean-Daniel Dupas <email@hidden>
- Date: Sat, 18 Oct 2014 23:23:18 +0200
AFAIK, variadic C functions are not (yet) callable from swift code.
> Le 18 oct. 2014 à 20:37, Rick Mann <email@hidden> a écrit :
>
> I need access to fcntl, so I thought I'd do what Apple does with Darwin. But I don't actually see how to do that. They create Darwin.stdio.fopen(), for example. But then how do they call the underlying C fopen()?
>
> For that matter, Swift can call C functions directly in some cases, and not at all in others.
>
> OH! Is it because fcntl is special? Check out its declaration:
>
> int fcntl(int, int, ...) __DARWIN_ALIAS_C(fcntl);
>
> __DARWIN_ALIAS_C is:
>
> #define __DARWIN_ALIAS_C(sym) __asm("_" __STRING(sym) __DARWIN_SUF_NON_CANCELABLE __DARWIN_SUF_UNIX03)
>
> So, is there some magic module I can create in Swift to make that accessible to my Swift code?
>
> --
> Rick Mann
> email@hidden
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
-- Jean-Daniel
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden