Skip to content

Conversation

@kmahar
Copy link
Contributor

@kmahar kmahar commented Oct 8, 2019

Drops support for Swift 4.2 and fixes various deprecation warnings that surfaced now that we are no longer using the Swift 5 compiler in 4.2 compatibility mode.

/// API methods that expect a location for a string. **You must only call this method on Data instances with
/// count > 0 so that the base address will exist.**
/// Based on https://mjtsai.com/blog/2019/03/27/swift-5-released/
fileprivate mutating func withUnsafeMutableCStringPointer<T>(body: (UnsafeMutablePointer<CChar>) throws -> T)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old way we were doing this was deprecated

/// methods that expect the location of an uint8_t. The pointer provided to `body` will be null if the `Data` has
/// count == 0.
/// Based on https://mjtsai.com/blog/2019/03/27/swift-5-released/
fileprivate func withUnsafeBytePointer<T>(body: (UnsafePointer<UInt8>?) throws -> T) rethrows -> T {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the old way we were doing this was deprecated

@kmahar kmahar merged commit e2da7f7 into master Oct 15, 2019
@kmahar kmahar deleted the drop-swift-4 branch October 15, 2019 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants