serval-dna/servaldswift.swift
Andrew Bettison f2eb2bf9ab Add Swift 3/4 'servaldswift' executable
If the Swift 3 or Swift 4 compiler is present or passed to the configure
script in the SWIFTC variable, then the Makefile will compile a Swift
'servaldswift' executable to ensure that the module map links correctly
into a stand-alone Swift program.

Use the gold linker if supported, to avoid relocation errors on symbols
produced by Swift when linking dynamic libraries.
2018-03-06 15:29:17 +10:30

15 lines
348 B
Swift

import Foundation
import servald.main
public func serval_daemon_main(args: [String]) -> CInt {
// print "args = \(args)"
var argv = args.map { strdup($0) }
argv.append(nil)
defer {
argv.forEach { free($0) }
}
return servald_main(CInt(argv.count - 1), &argv)
}
exit(serval_daemon_main(args: CommandLine.arguments))