Skip to content

Commit bb6ab43

Browse files
committed
Update availability declarations
1 parent e86702b commit bb6ab43

25 files changed

+114
-113
lines changed

Sources/System/Errno.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
/// An error number used by system calls to communicate what kind of error
1111
/// occurred.
1212
@frozen
13-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
13+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
1414
public struct Errno: RawRepresentable, Error, Hashable, Codable {
1515
/// The raw C error number.
1616
@_alwaysEmitIntoClient
@@ -1380,7 +1380,7 @@ public struct Errno: RawRepresentable, Error, Hashable, Codable {
13801380
}
13811381

13821382
// Constants defined in header but not man page
1383-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1383+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
13841384
extension Errno {
13851385

13861386
/// Operation would block.
@@ -1474,7 +1474,7 @@ extension Errno {
14741474
#endif
14751475
}
14761476

1477-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1477+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
14781478
extension Errno {
14791479
// TODO: We want to provide safe access to `errno`, but we need a
14801480
// release-barrier to do so.
@@ -1489,14 +1489,14 @@ extension Errno {
14891489
}
14901490

14911491
// Use "hidden" entry points for `NSError` bridging
1492-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1492+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
14931493
extension Errno {
14941494
public var _code: Int { Int(rawValue) }
14951495

14961496
public var _domain: String { "NSPOSIXErrorDomain" }
14971497
}
14981498

1499-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1499+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
15001500
extension Errno: CustomStringConvertible, CustomDebugStringConvertible {
15011501
/// A textual representation of the most recent error
15021502
/// returned by a system call.
@@ -1516,7 +1516,7 @@ extension Errno: CustomStringConvertible, CustomDebugStringConvertible {
15161516
public var debugDescription: String { self.description }
15171517
}
15181518

1519-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1519+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
15201520
extension Errno {
15211521
@_alwaysEmitIntoClient
15221522
public static func ~=(_ lhs: Errno, _ rhs: Error) -> Bool {

Sources/System/FileDescriptor.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/// of `FileDescriptor` values,
1515
/// in the same way as you manage a raw C file handle.
1616
@frozen
17-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
17+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
1818
public struct FileDescriptor: RawRepresentable, Hashable, Codable {
1919
/// The raw C file handle.
2020
@_alwaysEmitIntoClient
@@ -26,7 +26,7 @@ public struct FileDescriptor: RawRepresentable, Hashable, Codable {
2626
}
2727

2828
// Standard file descriptors.
29-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
29+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
3030
extension FileDescriptor {
3131
/// The standard input file descriptor, with a numeric value of 0.
3232
@_alwaysEmitIntoClient
@@ -41,7 +41,7 @@ extension FileDescriptor {
4141
public static var standardError: FileDescriptor { .init(rawValue: 2) }
4242
}
4343

44-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
44+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
4545
extension FileDescriptor {
4646
/// The desired read and write access for a newly opened file.
4747
@frozen
@@ -386,7 +386,7 @@ extension FileDescriptor {
386386
}
387387
}
388388

389-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
389+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
390390
extension FileDescriptor.AccessMode
391391
: CustomStringConvertible, CustomDebugStringConvertible
392392
{
@@ -405,7 +405,7 @@ extension FileDescriptor.AccessMode
405405
public var debugDescription: String { self.description }
406406
}
407407

408-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
408+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
409409
extension FileDescriptor.SeekOrigin
410410
: CustomStringConvertible, CustomDebugStringConvertible
411411
{
@@ -428,7 +428,7 @@ extension FileDescriptor.SeekOrigin
428428
public var debugDescription: String { self.description }
429429
}
430430

431-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
431+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
432432
extension FileDescriptor.OpenOptions
433433
: CustomStringConvertible, CustomDebugStringConvertible
434434
{

Sources/System/FileHelpers.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
See https://swift.org/LICENSE.txt for license information
88
*/
99

10-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
10+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
1111
extension FileDescriptor {
1212
/// Runs a closure and then closes the file descriptor, even if an error occurs.
1313
///

Sources/System/FileOperations.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
See https://swift.org/LICENSE.txt for license information
88
*/
99

10-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
10+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
1111
extension FileDescriptor {
1212
/// Opens or creates a file for reading or writing.
1313
///
@@ -369,7 +369,7 @@ extension FileDescriptor {
369369
}
370370
}
371371

372-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
372+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
373373
extension FileDescriptor {
374374
/// Duplicate this file descriptor and return the newly created copy.
375375
///
@@ -399,15 +399,15 @@ extension FileDescriptor {
399399
///
400400
/// The corresponding C functions are `dup` and `dup2`.
401401
@_alwaysEmitIntoClient
402-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
402+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
403403
public func duplicate(
404404
as target: FileDescriptor? = nil,
405405
retryOnInterrupt: Bool = true
406406
) throws -> FileDescriptor {
407407
try _duplicate(as: target, retryOnInterrupt: retryOnInterrupt).get()
408408
}
409409

410-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
410+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
411411
@usableFromInline
412412
internal func _duplicate(
413413
as target: FileDescriptor?,
@@ -435,20 +435,20 @@ extension FileDescriptor {
435435
}
436436

437437
#if !os(Windows)
438-
/*System 1.1.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
438+
@available(/*System 1.1.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
439439
extension FileDescriptor {
440440
/// Create a pipe, a unidirectional data channel which can be used for interprocess communication.
441441
///
442442
/// - Returns: The pair of file descriptors.
443443
///
444444
/// The corresponding C function is `pipe`.
445445
@_alwaysEmitIntoClient
446-
/*System 1.1.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
446+
@available(/*System 1.1.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
447447
public static func pipe() throws -> (readEnd: FileDescriptor, writeEnd: FileDescriptor) {
448448
try _pipe().get()
449449
}
450450

451-
/*System 1.1.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
451+
@available(/*System 1.1.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
452452
@usableFromInline
453453
internal static func _pipe() -> Result<(readEnd: FileDescriptor, writeEnd: FileDescriptor), Errno> {
454454
var fds: (Int32, Int32) = (-1, -1)
@@ -464,7 +464,7 @@ extension FileDescriptor {
464464
#endif
465465

466466
#if !os(Windows)
467-
/*System 1.2.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
467+
@available(/*System 1.2.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
468468
extension FileDescriptor {
469469
/// Truncate or extend the file referenced by this file descriptor.
470470
///
@@ -486,7 +486,7 @@ extension FileDescriptor {
486486
/// associated with the file.
487487
///
488488
/// The corresponding C function is `ftruncate`.
489-
/*System 1.2.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
489+
@available(/*System 1.2.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
490490
@_alwaysEmitIntoClient
491491
public func resize(
492492
to newSize: Int64,
@@ -498,7 +498,7 @@ extension FileDescriptor {
498498
).get()
499499
}
500500

501-
/*System 1.2.0, @available(macOS 9999, iOS 9999, watchOS 9999, tvOS 9999, *)*/
501+
@available(/*System 1.2.0: macOS 9999, iOS 9999, watchOS 9999, tvOS 9999*/iOS 8, *)
502502
@usableFromInline
503503
internal func _resize(
504504
to newSize: Int64,

Sources/System/FilePath/FilePath.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
See https://swift.org/LICENSE.txt for license information
88
*/
99

10-
// TODO(docs): Section on all the new syntactic operations, lexical normalization, decomposition,
11-
// components, etc.
12-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
1310
/// Represents a location in the file system.
1411
///
1512
/// This structure recognizes directory separators (e.g. `/`), roots, and
@@ -40,7 +37,10 @@
4037
/// However, the rules for path equivalence
4138
/// are file-system–specific and have additional considerations
4239
/// like case insensitivity, Unicode normalization, and symbolic links.
40+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
4341
public struct FilePath {
42+
// TODO(docs): Section on all the new syntactic operations, lexical normalization, decomposition,
43+
// components, etc.
4444
internal var _storage: SystemString
4545

4646
/// Creates an empty, null-terminated path.
@@ -59,13 +59,13 @@ public struct FilePath {
5959
}
6060
}
6161

62-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
62+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
6363
extension FilePath {
6464
/// The length of the file path, excluding the null terminator.
6565
public var length: Int { _storage.length }
6666
}
6767

68-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
68+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
6969
extension FilePath: Hashable, Codable {}
7070

7171
#if compiler(>=5.5) && canImport(_Concurrency)

Sources/System/FilePath/FilePathComponentView.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// MARK: - API
1111

12-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
12+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
1313
extension FilePath {
1414
/// A bidirectional, range replaceable collection of the non-root components
1515
/// that make up a file path.
@@ -88,7 +88,7 @@ extension FilePath {
8888
#endif
8989
}
9090

91-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
91+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
9292
extension FilePath.ComponentView: BidirectionalCollection {
9393
public typealias Element = FilePath.Component
9494
public struct Index: Comparable, Hashable {
@@ -122,7 +122,7 @@ extension FilePath.ComponentView: BidirectionalCollection {
122122
}
123123
}
124124

125-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
125+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
126126
extension FilePath.ComponentView: RangeReplaceableCollection {
127127
public init() {
128128
self.init(FilePath())
@@ -172,7 +172,7 @@ extension FilePath.ComponentView: RangeReplaceableCollection {
172172
}
173173
}
174174

175-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
175+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
176176
extension FilePath {
177177
/// Create a file path from a root and a collection of components.
178178
public init<C: Collection>(
@@ -201,7 +201,7 @@ extension FilePath {
201201

202202
// MARK: - Internals
203203

204-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
204+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
205205
extension FilePath.ComponentView: _PathSlice {
206206
internal var _range: Range<SystemString.Index> {
207207
_start ..< _path._storage.endIndex
@@ -214,7 +214,7 @@ extension FilePath.ComponentView: _PathSlice {
214214

215215
// MARK: - Invariants
216216

217-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
217+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
218218
extension FilePath.ComponentView {
219219
internal func _invariantCheck() {
220220
#if DEBUG

Sources/System/FilePath/FilePathComponents.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// MARK: - API
1111

12-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
12+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
1313
extension FilePath {
1414
/// Represents a root of a file path.
1515
///
@@ -72,7 +72,7 @@ extension FilePath {
7272
}
7373
}
7474

75-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
75+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
7676
extension FilePath.Component {
7777

7878
/// Whether a component is a regular file or directory name, or a special
@@ -97,7 +97,7 @@ extension FilePath.Component {
9797
}
9898
}
9999

100-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
100+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
101101
extension FilePath.Root {
102102
// TODO: Windows analysis APIs
103103
}
@@ -183,17 +183,17 @@ extension _PathSlice {
183183
internal var _storage: SystemString { _path._storage }
184184
}
185185

186-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
186+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
187187
extension FilePath.Component: _PathSlice {
188188
}
189-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
189+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
190190
extension FilePath.Root: _PathSlice {
191191
internal var _range: Range<SystemString.Index> {
192192
(..<_rootEnd).relative(to: _path._storage)
193193
}
194194
}
195195

196-
/*System 0.0.1, @available(macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0, *)*/
196+
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
197197
extension FilePath: _PlatformStringable {
198198
func _withPlatformString<Result>(_ body: (UnsafePointer<CInterop.PlatformChar>) throws -> Result) rethrows -> Result {
199199
try _storage.withPlatformString(body)
@@ -205,7 +205,7 @@ extension FilePath: _PlatformStringable {
205205

206206
}
207207

208-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
208+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
209209
extension FilePath.Component {
210210
// The index of the `.` denoting an extension
211211
internal func _extensionIndex() -> SystemString.Index? {
@@ -234,7 +234,7 @@ internal func _makeExtension(_ ext: String) -> SystemString {
234234
return result
235235
}
236236

237-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
237+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
238238
extension FilePath.Component {
239239
internal init?(_ str: SystemString) {
240240
// FIXME: explicit null root? Or something else?
@@ -247,7 +247,7 @@ extension FilePath.Component {
247247
}
248248
}
249249

250-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
250+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
251251
extension FilePath.Root {
252252
internal init?(_ str: SystemString) {
253253
// FIXME: explicit null root? Or something else?
@@ -262,7 +262,7 @@ extension FilePath.Root {
262262

263263
// MARK: - Invariants
264264

265-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
265+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
266266
extension FilePath.Component {
267267
// TODO: ensure this all gets easily optimized away in release...
268268
internal func _invariantCheck() {
@@ -275,7 +275,7 @@ extension FilePath.Component {
275275
}
276276
}
277277

278-
/*System 0.0.2, @available(macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0, *)*/
278+
@available(/*System 0.0.2: macOS 12.0, iOS 15.0, watchOS 8.0, tvOS 15.0*/iOS 8, *)
279279
extension FilePath.Root {
280280
internal func _invariantCheck() {
281281
#if DEBUG

0 commit comments

Comments
 (0)