• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How does the Swift Darwin module work?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How does the Swift Darwin module work?
      • From: Roland King <email@hidden>
References: 
 >How does the Swift Darwin module work? (From: Rick Mann <email@hidden>)

  • Prev by Date: Set UICollectionView UIScrollViewDelegate delegate
  • Next by Date: Re: Set UICollectionView UIScrollViewDelegate delegate
  • Previous by thread: How does the Swift Darwin module work?
  • Next by thread: Re: How does the Swift Darwin module work?
  • Index(es):
    • Date
    • Thread