From adbf8d285669fc5d97fe0fb9c68d61ac69c632ea Mon Sep 17 00:00:00 2001 From: Guillaume Lessard Date: Wed, 21 Jun 2023 14:50:47 -0700 Subject: [PATCH] Add availability attributes to `Sendable` conformances --- Sources/System/FileDescriptor.swift | 5 +++++ Sources/System/FilePath/FilePath.swift | 1 + Sources/System/FilePath/FilePathComponentView.swift | 3 +++ Sources/System/FilePath/FilePathComponents.swift | 5 +++++ Sources/System/FilePermissions.swift | 1 + 5 files changed, 15 insertions(+) diff --git a/Sources/System/FileDescriptor.swift b/Sources/System/FileDescriptor.swift index 292c2a5..556e63e 100644 --- a/Sources/System/FileDescriptor.swift +++ b/Sources/System/FileDescriptor.swift @@ -481,7 +481,12 @@ extension FileDescriptor.OpenOptions //@available(*, unavailable, message: "File descriptors are not completely thread-safe.") //extension FileDescriptor: Sendable {} +@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *) extension FileDescriptor.AccessMode: Sendable {} + +@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *) extension FileDescriptor.OpenOptions: Sendable {} + +@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *) extension FileDescriptor.SeekOrigin: Sendable {} #endif diff --git a/Sources/System/FilePath/FilePath.swift b/Sources/System/FilePath/FilePath.swift index 09b8142..c1dfd7f 100644 --- a/Sources/System/FilePath/FilePath.swift +++ b/Sources/System/FilePath/FilePath.swift @@ -69,5 +69,6 @@ extension FilePath { extension FilePath: Hashable, Codable {} #if compiler(>=5.5) && canImport(_Concurrency) +@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *) extension FilePath: Sendable {} #endif diff --git a/Sources/System/FilePath/FilePathComponentView.swift b/Sources/System/FilePath/FilePathComponentView.swift index 157b239..efdd084 100644 --- a/Sources/System/FilePath/FilePathComponentView.swift +++ b/Sources/System/FilePath/FilePathComponentView.swift @@ -241,6 +241,9 @@ extension FilePath.ComponentView { } #if compiler(>=5.5) && canImport(_Concurrency) +@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *) extension FilePath.ComponentView: Sendable {} + +@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *) extension FilePath.ComponentView.Index: Sendable {} #endif diff --git a/Sources/System/FilePath/FilePathComponents.swift b/Sources/System/FilePath/FilePathComponents.swift index 782561c..ecd713e 100644 --- a/Sources/System/FilePath/FilePathComponents.swift +++ b/Sources/System/FilePath/FilePathComponents.swift @@ -287,7 +287,12 @@ extension FilePath.Root { } #if compiler(>=5.5) && canImport(_Concurrency) +@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *) extension FilePath.Root: Sendable {} + +@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *) extension FilePath.Component: Sendable {} + +@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *) extension FilePath.Component.Kind: Sendable {} #endif diff --git a/Sources/System/FilePermissions.swift b/Sources/System/FilePermissions.swift index bd899ce..9bd6c5f 100644 --- a/Sources/System/FilePermissions.swift +++ b/Sources/System/FilePermissions.swift @@ -177,5 +177,6 @@ extension FilePermissions } #if compiler(>=5.5) && canImport(_Concurrency) +@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *) extension FilePermissions: Sendable {} #endif