diff options
Diffstat (limited to 'Tests/SwiftMix/SwiftMain.swift')
-rw-r--r-- | Tests/SwiftMix/SwiftMain.swift | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Tests/SwiftMix/SwiftMain.swift b/Tests/SwiftMix/SwiftMain.swift index 3629ac8..921439a 100644 --- a/Tests/SwiftMix/SwiftMain.swift +++ b/Tests/SwiftMix/SwiftMain.swift @@ -3,10 +3,17 @@ import Foundation @objc class SwiftMainClass : NSObject { class func SwiftMain(argc:Int, argv:UnsafePointer<UnsafePointer<CChar>>) -> Int32 { dump("argc: \(argc)") +#if swift(>=3.0) + for i in 0 ..< argc { + let argi = String(cString:argv[i]); + dump("arg[\(i)]: \(argi)"); + } +#else for (var i = 0; i < argc; ++i) { let argi = String.fromCString(argv[i]) dump("arg[\(i)]: \(argi)"); } +#endif return 0; } } |