Skip to content

Commit

Permalink
Compatibility with Swift 3.0 Preview 1 on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Obbut committed Jun 14, 2016
1 parent d770209 commit 677b060
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Sources/Compatibility.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,23 @@
//
//

#if !swift(>=3.0)
import Foundation

#if !swift(>=3.0) || os(Linux)
typealias ProcessInfo = NSProcessInfo

import Foundation
extension String {
struct Encoding {
static let utf8 = NSUTF8StringEncoding
}
}
#endif


#if !swift(>=3.0)

typealias ErrorProtocol = ErrorType
typealias Sequence = SequenceType
typealias ProcessInfo = NSProcessInfo

extension Array {
func index(`where` predicate: (Element) throws -> Bool) rethrows -> Int? {
Expand Down Expand Up @@ -54,10 +64,6 @@
func components(separatedBy separator: String) -> [String] {
return self.componentsSeparatedByString(separator)
}

struct Encoding {
static let utf8 = NSUTF8StringEncoding
}
}

extension SequenceType {
Expand Down

0 comments on commit 677b060

Please sign in to comment.