Skip to content

Commit 97a604c

Browse files
authored
Foundation: update availability annotation spellings (NFCI)
Prefer to use the updated `macOS` for the OS spelling rather than the legacy `OSX` spelling.
1 parent 9b1d17f commit 97a604c

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

Darwin/Foundation-swiftoverlay-Tests/TestCalendar.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class TestCalendar : XCTestCase {
114114

115115
func test_properties() {
116116
// Mainly we want to just make sure these go through to the NSCalendar implementation at this point.
117-
if #available(iOS 8.0, OSX 10.7, *) {
117+
if #available(iOS 8.0, macOS 10.7, *) {
118118
var c = Calendar(identifier: .gregorian)
119119
// Use english localization
120120
c.locale = Locale(identifier: "en_US")
@@ -158,7 +158,7 @@ class TestCalendar : XCTestCase {
158158
XCTAssertEqual(Date(timeIntervalSince1970: 1468652400.0), d1)
159159
XCTAssertEqual(86400, ti)
160160

161-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
161+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
162162
let dateInterval = c.dateInterval(of: .day, for: d)
163163
XCTAssertEqual(DateInterval(start: d1, duration: ti), dateInterval)
164164
}
@@ -202,7 +202,7 @@ class TestCalendar : XCTestCase {
202202

203203
XCTAssertTrue(c.dateIntervalOfWeekend(containing: d, start: &d1, interval: &ti))
204204

205-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
205+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
206206
let thisWeekend = DateInterval(start: Date(timeIntervalSince1970: 1468652400.0), duration: 172800.0)
207207

208208
XCTAssertEqual(thisWeekend, DateInterval(start: d1, duration: ti))
@@ -212,7 +212,7 @@ class TestCalendar : XCTestCase {
212212

213213
XCTAssertTrue(c.nextWeekend(startingAfter: d, start: &d1, interval: &ti))
214214

215-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
215+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
216216
let nextWeekend = DateInterval(start: Date(timeIntervalSince1970: 1469257200.0), duration: 172800.0)
217217

218218
XCTAssertEqual(nextWeekend, DateInterval(start: d1, duration: ti))

Darwin/Foundation-swiftoverlay-Tests/TestDateInterval.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class TestDateInterval : XCTestCase {
2323
}
2424

2525
func test_compareDateIntervals() {
26-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
26+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
2727
let start = dateWithString("2010-05-17 14:49:47 -0700")
2828
let duration: TimeInterval = 10000000.0
2929
let testInterval1 = DateInterval(start: start, duration: duration)
@@ -45,7 +45,7 @@ class TestDateInterval : XCTestCase {
4545
}
4646

4747
func test_isEqualToDateInterval() {
48-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
48+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
4949
let start = dateWithString("2010-05-17 14:49:47 -0700")
5050
let duration = 10000000.0
5151
let testInterval1 = DateInterval(start: start, duration: duration)
@@ -89,7 +89,7 @@ class TestDateInterval : XCTestCase {
8989
}
9090

9191
func test_checkIntersection() {
92-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
92+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
9393
let start1 = dateWithString("2010-05-17 14:49:47 -0700")
9494
let end1 = dateWithString("2010-08-17 14:49:47 -0700")
9595

@@ -112,7 +112,7 @@ class TestDateInterval : XCTestCase {
112112
}
113113

114114
func test_validIntersections() {
115-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
115+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
116116
let start1 = dateWithString("2010-05-17 14:49:47 -0700")
117117
let end1 = dateWithString("2010-08-17 14:49:47 -0700")
118118

@@ -139,7 +139,7 @@ class TestDateInterval : XCTestCase {
139139
}
140140

141141
func test_containsDate() {
142-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
142+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
143143
let start = dateWithString("2010-05-17 14:49:47 -0700")
144144
let duration = 10000000.0
145145

@@ -154,7 +154,7 @@ class TestDateInterval : XCTestCase {
154154
}
155155

156156
func test_AnyHashableContainingDateInterval() {
157-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
157+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
158158
let start = dateWithString("2010-05-17 14:49:47 -0700")
159159
let duration = 10000000.0
160160
let values: [DateInterval] = [
@@ -172,7 +172,7 @@ class TestDateInterval : XCTestCase {
172172
}
173173

174174
func test_AnyHashableCreatedFromNSDateInterval() {
175-
if #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) {
175+
if #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) {
176176
let start = dateWithString("2010-05-17 14:49:47 -0700")
177177
let duration = 10000000.0
178178
let values: [NSDateInterval] = [

Darwin/Foundation-swiftoverlay-Tests/TestMeasurement.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Foundation
1414
import XCTest
1515

1616
// We define our own units here so that we can have closer control over checking the behavior of just struct Measurement and not the rest of Foundation
17-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
17+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
1818
class MyDimensionalUnit : Dimension {
1919
class var unitA : MyDimensionalUnit {
2020
return MyDimensionalUnit(symbol: "a", converter: UnitConverterLinear(coefficient: 1))
@@ -30,7 +30,7 @@ class MyDimensionalUnit : Dimension {
3030
}
3131
}
3232

33-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
33+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
3434
class CustomUnit : Unit {
3535
override init(symbol: String) {
3636
super.init(symbol: symbol)
@@ -44,7 +44,7 @@ class CustomUnit : Unit {
4444
public static let features = CustomUnit(symbol: "feature")
4545
}
4646

47-
@available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
47+
@available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *)
4848
class TestMeasurement : XCTestCase {
4949

5050
func testBasicConstruction() {

Darwin/Foundation-swiftoverlay-Tests/TestPersonNameComponents.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import CoreFoundation
1515
import XCTest
1616

1717
class TestPersonNameComponents : XCTestCase {
18-
@available(OSX 10.11, iOS 9.0, *)
18+
@available(macOS 10.11, iOS 9.0, *)
1919
func makePersonNameComponents(givenName: String, familyName: String) -> PersonNameComponents {
2020
var result = PersonNameComponents()
2121
result.givenName = givenName
@@ -70,7 +70,7 @@ class TestPersonNameComponents : XCTestCase {
7070
}
7171
}
7272

73-
@available(OSX 10.11, iOS 9.0, *)
73+
@available(macOS 10.11, iOS 9.0, *)
7474
func makeNSPersonNameComponents(givenName: String, familyName: String) -> NSPersonNameComponents {
7575
let result = NSPersonNameComponents()
7676
result.givenName = givenName

Sources/Foundation/Operation.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ extension OperationQueue {
756756
public static let defaultMaxConcurrentOperationCount: Int = -1
757757
}
758758

759-
@available(OSX 10.5, *)
759+
@available(macOS 10.5, *)
760760
open class OperationQueue : NSObject, ProgressReporting {
761761
let __queueLock = NSLock()
762762
let __atomicLoad = NSLock()
@@ -1423,15 +1423,15 @@ open class OperationQueue : NSObject, ProgressReporting {
14231423
extension OperationQueue {
14241424
// These two functions are inherently a race condition and should be avoided if possible
14251425

1426-
@available(OSX, introduced: 10.5, deprecated: 100000, message: "access to operations is inherently a race condition, it should not be used. For barrier style behaviors please use addBarrierBlock: instead")
1426+
@available(macOS, introduced: 10.5, deprecated: 100000, message: "access to operations is inherently a race condition, it should not be used. For barrier style behaviors please use addBarrierBlock: instead")
14271427
open var operations: [Operation] {
14281428
get {
14291429
return _operations(includingBarriers: false)
14301430
}
14311431
}
14321432

14331433

1434-
@available(OSX, introduced: 10.6, deprecated: 100000)
1434+
@available(macOS, introduced: 10.6, deprecated: 100000)
14351435
open var operationCount: Int {
14361436
get {
14371437
return _operationCount

Tests/Foundation/Tests/TestDateInterval.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class TestDateInterval: XCTestCase {
135135
}
136136

137137
func test_hashing() {
138-
guard #available(iOS 10.10, OSX 10.12, tvOS 10.0, watchOS 3.0, *) else { return }
138+
guard #available(iOS 10.10, macOS 10.12, tvOS 10.0, watchOS 3.0, *) else { return }
139139

140140
let start1a = dateWithString("2019-04-04 17:09:23 -0700")
141141
let start1b = dateWithString("2019-04-04 17:09:23 -0700")

Tests/Foundation/Tests/TestNSTextCheckingResult.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class TestNSTextCheckingResult: XCTestCase {
7676

7777

7878
func test_rangeWithName() {
79-
guard #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) else {
79+
guard #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) else {
8080
return
8181
}
8282

0 commit comments

Comments
 (0)