Skip to content

Commit

Permalink
Merge pull request #242 from IBM-Swift/issue.swift41-2
Browse files Browse the repository at this point in the history
Support Swift 4.1
  • Loading branch information
ShihabMehboob committed Feb 26, 2018
2 parents 0837058 + 0701172 commit 0c39115
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ matrix:
- os: osx
osx_image: xcode9.2
sudo: required
env: SWIFT_SNAPSHOT=4.0.3
- os: linux
dist: trusty
sudo: required
env: SWIFT_SNAPSHOT=swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-06-a
- os: osx
osx_image: xcode9.2
sudo: required
env: SWIFT_SNAPSHOT=swift-4.1-DEVELOPMENT-SNAPSHOT-2018-02-06-a

script:
- ./build.sh
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import PackageDescription

var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", .upToNextMinor(from: "1.7.0")),
.package(url: "https://github.com/IBM-Swift/LoggerAPI.git", from: "2.0.0"),
.package(url: "https://github.com/IBM-Swift/BlueSocket.git", .upToNextMinor(from: "0.12.0")),
.package(url: "https://github.com/IBM-Swift/CCurl.git", .upToNextMinor(from: "0.4.0")),
.package(url: "https://github.com/IBM-Swift/CCurl.git", from: "1.0.0"),
.package(url: "https://github.com/IBM-Swift/BlueSSLService.git", .upToNextMinor(from: "0.12.0"))
]

Expand Down
6 changes: 5 additions & 1 deletion Sources/KituraNet/BufferList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@ public class BufferList {

let result = min(length, localData.length - byteIndex)
let bytes = localData.bytes.assumingMemoryBound(to: UInt8.self) + byteIndex
UnsafeMutableRawPointer(buffer).copyBytes(from: bytes, count: result)
#if swift(>=4.1)
UnsafeMutableRawPointer(buffer).copyMemory(from: bytes, byteCount: result)
#else
UnsafeMutableRawPointer(buffer).copyBytes(from: bytes, count: result)
#endif
byteIndex += result

return result
Expand Down
2 changes: 1 addition & 1 deletion Sources/KituraNet/IncomingSocketProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public protocol IncomingSocketProcessor: class {

/// A back reference to the `IncomingSocketHandler` processing the socket that
/// this `IncomingDataProcessor` is processing.
weak var handler: IncomingSocketHandler? { get set }
var handler: IncomingSocketHandler? { get set }

/// Process data read from the socket.
///
Expand Down

0 comments on commit 0c39115

Please sign in to comment.