mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-30 01:48:54 +00:00
Fix Swift compile error on ARM 64-bit
This commit is contained in:
parent
7993332fe9
commit
bb5fc482c7
@ -101,11 +101,24 @@ private func cliPuts(_ context: UnsafeMutablePointer<cli_context>?, _ str: Unsaf
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The va_list C type on i386, armv7 and i86_64 is CVaListPointer, whereas on
|
||||||
|
// arm64 it is Optional<CVaListPointer>.
|
||||||
|
#if arch(arm64)
|
||||||
|
|
||||||
|
private func cliVprintf(_ context: UnsafeMutablePointer<cli_context>?, _ fmt: UnsafePointer<CChar>?, _ ap: CVaListPointer?) -> Void {
|
||||||
|
let str = NSString(format: String(cString: fmt!), arguments: ap!)
|
||||||
|
_self(context).putString(String(data: str.data(using: String.Encoding.utf16.rawValue)!, encoding:.utf16)!)
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
private func cliVprintf(_ context: UnsafeMutablePointer<cli_context>?, _ fmt: UnsafePointer<CChar>?, _ ap: CVaListPointer) -> Void {
|
private func cliVprintf(_ context: UnsafeMutablePointer<cli_context>?, _ fmt: UnsafePointer<CChar>?, _ ap: CVaListPointer) -> Void {
|
||||||
let str = NSString(format: String(cString: fmt!), arguments: ap)
|
let str = NSString(format: String(cString: fmt!), arguments: ap)
|
||||||
_self(context).putString(String(data: str.data(using: String.Encoding.utf16.rawValue)!, encoding:.utf16)!)
|
_self(context).putString(String(data: str.data(using: String.Encoding.utf16.rawValue)!, encoding:.utf16)!)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
private func cliPutLong(_ context: UnsafeMutablePointer<cli_context>?, _ value: Int64, _ delim: UnsafePointer<CChar>?) -> Void {
|
private func cliPutLong(_ context: UnsafeMutablePointer<cli_context>?, _ value: Int64, _ delim: UnsafePointer<CChar>?) -> Void {
|
||||||
_self(context).putLong(value, delim != nil ? String(cString: delim!) : nil)
|
_self(context).putLong(value, delim != nil ? String(cString: delim!) : nil)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user