Files
SWCompression/Tests/FileHandle+CloseCompat.swift
T
2022-09-24 13:25:46 +03:00

19 lines
357 B
Swift

// Copyright (c) 2022 Timofey Solomko
// Licensed under MIT License
//
// See LICENSE for license informations
import Foundation
extension FileHandle {
func closeCompat() throws {
if #available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *) {
try self.close()
} else {
self.closeFile()
}
}
}