Re: [swift-dev] C Macros and Variadic functions

2016-01-06 Thread Thomas Catterall via swift-dev
It seems to me that an interesting tool in the swift toolchain would be one that could generate implementations of methods in circumstances like this, using, for instance, CPP macros as hints for function prototypes. Then again, I might be entirely wrong and I'd be happy to be corrected! Tom S

Re: [swift-dev] C Macros and Variadic functions

2016-01-06 Thread Kate Stone via swift-dev
Apologies for the poor guidance. I had success with this path much earlier in Swift’s evolution and I’m clearly not up to date on the latest recommendations. Joe’s approach is definitely the right way to go. Kate Stone k8st...@apple.com  Xcode Low Level Tools > On

Re: [swift-dev] C Macros and Variadic functions

2016-01-06 Thread Joe Groff via swift-dev
> On Jan 5, 2016, at 1:57 PM, Kate Stone via swift-dev > wrote: > >> On Jan 5, 2016, at 12:32 PM, Ryan Lovelett via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> Just to be clear though the intent of my question was not to quibble >> with compiler error messages. My real question is

Re: [swift-dev] C Macros and Variadic functions

2016-01-05 Thread Ryan Lovelett via swift-dev
First off thanks for the help. No doubt I'm doing something wrong. I wish I could help debug my own problem but I don't really get what @_silgen_name does. That seems like black magic to me. That compiled though now it won't link. I've put the code up as a Gist here[1]. $ swift build Linking Exe

Re: [swift-dev] C Macros and Variadic functions

2016-01-05 Thread Kate Stone via swift-dev
> On Jan 5, 2016, at 12:32 PM, Ryan Lovelett via swift-dev > wrote: > > Just to be clear though the intent of my question was not to quibble > with compiler error messages. My real question is how are we meant to do > systems programming with Swift on Linux if we cannot call ioctl? In the absen

Re: [swift-dev] C Macros and Variadic functions

2016-01-05 Thread Ryan Lovelett via swift-dev
Response inline: On Tue, Jan 5, 2016, at 03:12 PM, Xi Ge wrote: > > > On Jan 5, 2016, at 11:54 AM, Ryan Lovelett via swift-dev > > wrote: > > > > I'm beginning to try to port some of my existing C code over to Swift > > (you have no idea how excited that makes me). Unfortunately, I've hit a >

Re: [swift-dev] C Macros and Variadic functions

2016-01-05 Thread Xi Ge via swift-dev
> On Jan 5, 2016, at 11:54 AM, Ryan Lovelett via swift-dev > wrote: > > I'm beginning to try to port some of my existing C code over to Swift > (you have no idea how excited that makes me). Unfortunately, I've hit a > stumbling block. > > When interacting with some of the system/hardware inter

[swift-dev] C Macros and Variadic functions

2016-01-05 Thread Ryan Lovelett via swift-dev
I'm beginning to try to port some of my existing C code over to Swift (you have no idea how excited that makes me). Unfortunately, I've hit a stumbling block. When interacting with some of the system/hardware interfaces in Linux it sometimes (often?) becomes necessary to interact with I/O Control