Skip to content

Commit 66cb2e4

Browse files
committed
Swift4 Only changes and set swift-version to 4
1 parent d8f78f9 commit 66cb2e4

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Foundation/NSURLSession/http/HTTPBodySource.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,13 @@ internal final class _HTTPBodyFileSource {
125125
var fileSystemRepresentation: UnsafePointer<Int8>! = nil
126126
fileURL.withUnsafeFileSystemRepresentation {
127127
fileSystemRepresentation = $0
128-
}
129-
self.channel = DispatchIO(type: .stream, path: fileSystemRepresentation, oflag: O_RDONLY, mode: 0, queue: workQueue, cleanupHandler: {_ in })
128+
}
129+
guard let channel = DispatchIO(type: .stream, path: fileSystemRepresentation,
130+
oflag: O_RDONLY, mode: 0, queue: workQueue,
131+
cleanupHandler: {_ in }) else {
132+
fatalError("Cant create DispatchIO channel")
133+
}
134+
self.channel = channel
130135
self.channel.setLimit(highWater: CFURLSessionMaxWriteSize)
131136
}
132137

lib/phases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def generate(self):
173173
generated += " -I" + Configuration.current.build_directory.relative()
174174
swiftflags = TargetConditional.value(self.product.SWIFTCFLAGS)
175175
# Force building in Swift 3 compatibility mode.
176-
swiftflags += " -swift-version 3"
176+
swiftflags += " -swift-version 4"
177177
if swiftflags is not None:
178178
generated += " " + swiftflags
179179
return generated
@@ -434,7 +434,7 @@ def generate(self):
434434
# Note: Fix -swift-version 3 for now.
435435
return """
436436
build """ + appName + """: SwiftExecutable """ + swiftSources + self.generate_dependencies(libDependencyName) + """
437-
flags = -swift-version 3 -I""" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + self.product.ROOT_HEADERS_FOLDER_PATH + " -I" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + " -L" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + " " + TargetConditional.value(self.product.SWIFTCFLAGS) + """
437+
flags = -swift-version 4 -I""" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + self.product.ROOT_HEADERS_FOLDER_PATH + " -I" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + " -L" + Configuration.current.build_directory.path_by_appending(self.product.name).relative() + " " + TargetConditional.value(self.product.SWIFTCFLAGS) + """
438438
build """ + self.executableName + """: phony | """ + appName + """
439439
"""
440440

0 commit comments

Comments
 (0)