Skip to content

Commit

Permalink
Precise available OS version conditions in FileHandle throwing legacy…
Browse files Browse the repository at this point in the history
… functions.
  • Loading branch information
DnV1eX committed Sep 17, 2020
1 parent 287947b commit 4c0d407
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Sources/GoogleCloudLogging/GoogleCloudLogHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -459,23 +459,23 @@ extension FileHandle {

@discardableResult
func legacySeekToEnd() throws -> UInt64 {
if #available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
if #available(OSX 10.15, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
return try seekToEnd()
} else {
return seekToEndOfFile()
}
}

func legacyWrite<T>(contentsOf data: T) throws where T : DataProtocol {
if #available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
if #available(OSX 10.15, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
try write(contentsOf: data)
} else {
write(Data(data))
}
}

func legacyReadToEnd() throws -> Data? {
if #available(OSX 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) {
if #available(OSX 10.15, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
return try readToEnd()
} else {
return readDataToEndOfFile()
Expand Down

0 comments on commit 4c0d407

Please sign in to comment.