One example of this is ioctl
error: 'ioctl' is unavailable: Variadic function is unavailable
Darwin.ioctl:2:13: note: 'ioctl' has been explicitly marked unavailable here
public func ioctl(_: Int32, _: UInt, _ varargs: Swift.Any...) -> Int32
When it was imported from C, it appears to be properly marked as accepting varargs.
Is this the case?
Why would it be marked explicitly unavailable? Doesn't Swift 3.0 add support for this?
The only way to get around this is to create a wrapper function in C that is not variadic. However, an effort is underway to create wrappers for the functions in Darwin that need it, and recently multiple were added for ioctl by this commit.
To use the wrapper, you need to have a swift version at least as new as the June 22nd snapshot. Make sure you are using that toolchain.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With