[swift-dev] Returning more than two scalars from C code

2016-03-22 Thread Bryan Chan via swift-dev
I tried to google for an answer but couldn't find anything. What is the correct way to do the following on Linux? @_silgen_name("foo") func foo(theInt: UInt) -> (a: UInt, b: UInt, c: UInt) var (d, e, f) = foo(aNum) Where foo is: typedef struct { long a; long b; long c;

Re: [swift-dev] Returning more than two scalars from C code

2016-03-22 Thread Bryan Chan via swift-dev
jgr...@apple.com wrote on 2016-03-22 12:05:06 PM: > On Mar 22, 2016, at 5:57 AM, Bryan Chan via swift-dev wrote: > > > I tried to google for an answer but couldn't find anything. What is > > the correct way to do the following on Linux? > > > > @_silgen_na

Re: [swift-dev] Returning more than two scalars from C code

2016-03-22 Thread Bryan Chan via swift-dev
jgr...@apple.com wrote on 2016-03-22 02:37:47 PM: > The runtime functions are hacked in various unsavory ways to give > them Swift-like calling conventions. Many of them also have > important semantics that the compiler needs to be aware of, so if > they aren't exported as standard library API in

Re: [swift-dev] Returning more than two scalars from C code

2016-03-30 Thread Bryan Chan via swift-dev
Thanks for your responses so far. It took me a while to fully appreciate what all this means. I have read through John's mail thread on llvm-dev about adding the swiftcc convention to LLVM/Clang. I don't think that discussion mentioned adding Clang support for C++ functions returning aggregates in