Skip to content

Commit 2d23cf3

Browse files
authored
Use macOS instead of OSX (#4640)
1 parent 8ffea5d commit 2d23cf3

13 files changed

+48
-48
lines changed

Diff for: Darwin/Foundation-swiftoverlay-Tests/TestCharacterSet.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ class TestCharacterSet : XCTestCase {
269269

270270
func test_setOperationsOfEmptySet() {
271271
// The following tests pass on these versions of the OS
272-
if #available(OSX 10.12.3, iOS 10.3, watchOS 3.2, tvOS 10.2, *) {
272+
if #available(macOS 10.12.3, iOS 10.3, watchOS 3.2, tvOS 10.2, *) {
273273
let emptySet = CharacterSet()
274274
let abcSet = CharacterSet(charactersIn: "abc")
275275

@@ -304,7 +304,7 @@ class TestCharacterSet : XCTestCase {
304304

305305
/* Disabled now: rdar://problem/31746923
306306
#if os(macOS)
307-
if #available(OSX 10.12.4, iOS 10.3, watchOS 3.2, tvOS 10.2, *) {
307+
if #available(macOS 10.12.4, iOS 10.3, watchOS 3.2, tvOS 10.2, *) {
308308
let abcSet = CharacterSet(charactersIn: "abc")
309309
let abcdSet = CharacterSet(charactersIn: "abcd")
310310

Diff for: Darwin/Foundation-swiftoverlay-Tests/TestJSONEncoder.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ class TestJSONEncoder : XCTestCase {
135135
}
136136

137137
let model = Model.testValue
138-
if #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
138+
if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
139139
let expectedJSON = "{\"top\":{\"first\":\"Johnny Appleseed\",\"second\":\"[email protected]\"}}".data(using: .utf8)!
140140
_testRoundTrip(of: model, expectedJSON: expectedJSON, outputFormatting: [.sortedKeys])
141141
} else {
@@ -178,7 +178,7 @@ class TestJSONEncoder : XCTestCase {
178178
let model = Model.testValue
179179
// This following test would fail as it attempts to re-encode into already encoded container is invalid. This will always fail
180180
expectCrashLater()
181-
if #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
181+
if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
182182
_testEncodeFailure(of: model)
183183
} else {
184184
_testEncodeFailure(of: model)
@@ -200,15 +200,15 @@ class TestJSONEncoder : XCTestCase {
200200
}
201201

202202
func testEncodingOutputFormattingSortedKeys() {
203-
if #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
203+
if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
204204
let expectedJSON = "{\"email\":\"[email protected]\",\"name\":\"Johnny Appleseed\"}".data(using: .utf8)!
205205
let person = Person.testValue
206206
_testRoundTrip(of: person, expectedJSON: expectedJSON, outputFormatting: [.sortedKeys])
207207
}
208208
}
209209

210210
func testEncodingOutputFormattingPrettyPrintedSortedKeys() {
211-
if #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
211+
if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
212212
let expectedJSON = "{\n \"email\" : \"[email protected]\",\n \"name\" : \"Johnny Appleseed\"\n}".data(using: .utf8)!
213213
let person = Person.testValue
214214
_testRoundTrip(of: person, expectedJSON: expectedJSON, outputFormatting: [.prettyPrinted, .sortedKeys])
@@ -307,7 +307,7 @@ class TestJSONEncoder : XCTestCase {
307307
}
308308

309309
func testEncodingDateISO8601() {
310-
if #available(OSX 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
310+
if #available(macOS 10.12, iOS 10.0, watchOS 3.0, tvOS 10.0, *) {
311311
let formatter = ISO8601DateFormatter()
312312
formatter.formatOptions = .withInternetDateTime
313313

Diff for: Darwin/Foundation-swiftoverlay-Tests/TestPersonNameComponents.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class TestPersonNameComponents : XCTestCase {
5555
}
5656

5757
func test_AnyHashableContainingPersonNameComponents() {
58-
if #available(OSX 10.11, iOS 9.0, *) {
58+
if #available(macOS 10.11, iOS 9.0, *) {
5959
let values: [PersonNameComponents] = [
6060
makePersonNameComponents(givenName: "Kevin", familyName: "Frank"),
6161
makePersonNameComponents(givenName: "John", familyName: "Appleseed"),
@@ -79,7 +79,7 @@ class TestPersonNameComponents : XCTestCase {
7979
}
8080

8181
func test_AnyHashableCreatedFromNSPersonNameComponents() {
82-
if #available(OSX 10.11, iOS 9.0, *) {
82+
if #available(macOS 10.11, iOS 9.0, *) {
8383
let values: [NSPersonNameComponents] = [
8484
makeNSPersonNameComponents(givenName: "Kevin", familyName: "Frank"),
8585
makeNSPersonNameComponents(givenName: "John", familyName: "Appleseed"),

Diff for: Darwin/Foundation-swiftoverlay-Tests/TestProgress.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import XCTest
1515

1616
class TestProgress : XCTestCase {
1717
func testUserInfoConveniences() {
18-
if #available(OSX 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
18+
if #available(macOS 10.13, iOS 11.0, watchOS 4.0, tvOS 11.0, *) {
1919
let p = Progress(parent:nil, userInfo: nil)
2020

2121
XCTAssertNil(p.userInfo[.throughputKey])
@@ -45,7 +45,7 @@ class TestProgress : XCTestCase {
4545
}
4646

4747
func testPerformAsCurrent() {
48-
if #available(OSX 10.11, iOS 8.0, *) {
48+
if #available(macOS 10.11, iOS 8.0, *) {
4949
// This test can be enabled once <rdar://problem/31867347> is in the SDK
5050
/*
5151
let p = Progress.discreteProgress(totalUnitCount: 10)

Diff for: Darwin/Foundation-swiftoverlay-Tests/TestURL.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class TestURL : XCTestCase {
6363
#if os(macOS)
6464
func testQuarantineProperties() {
6565
// Test the quarantine stuff; it has special logic
66-
if #available(OSX 10.11, iOS 9.0, *) {
66+
if #available(macOS 10.11, iOS 9.0, *) {
6767
// Create a temporary file
6868
var file = URL(fileURLWithPath: NSTemporaryDirectory())
6969
let name = "my_great_file" + UUID().uuidString
@@ -179,13 +179,13 @@ class TestURL : XCTestCase {
179179
XCTAssertEqual("www.apple.com", components.host)
180180

181181

182-
if #available(OSX 10.11, iOS 9.0, *) {
182+
if #available(macOS 10.11, iOS 9.0, *) {
183183
let rangeOfHost = components.rangeOfHost!
184184
XCTAssertNotNil(rangeOfHost)
185185
XCTAssertEqual(s[rangeOfHost], "www.apple.com")
186186
}
187187

188-
if #available(OSX 10.10, iOS 8.0, *) {
188+
if #available(macOS 10.10, iOS 8.0, *) {
189189
let qi = components.queryItems!
190190
XCTAssertNotNil(qi)
191191

@@ -197,7 +197,7 @@ class TestURL : XCTestCase {
197197
XCTAssertEqual("global|nav", first.value)
198198
}
199199

200-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
200+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
201201
components.percentEncodedQuery = "name1%E2%80%A2=value1%E2%80%A2&name2%E2%80%A2=value2%E2%80%A2"
202202
var qi = components.queryItems!
203203
XCTAssertNotNil(qi)
@@ -349,7 +349,7 @@ class TestURL : XCTestCase {
349349
}
350350

351351
func test_AnyHashableContainingURLQueryItem() {
352-
if #available(OSX 10.10, iOS 8.0, *) {
352+
if #available(macOS 10.10, iOS 8.0, *) {
353353
let values: [URLQueryItem] = [
354354
URLQueryItem(name: "foo", value: nil),
355355
URLQueryItem(name: "bar", value: nil),
@@ -365,7 +365,7 @@ class TestURL : XCTestCase {
365365
}
366366

367367
func test_AnyHashableCreatedFromNSURLQueryItem() {
368-
if #available(OSX 10.10, iOS 8.0, *) {
368+
if #available(macOS 10.10, iOS 8.0, *) {
369369
let values: [NSURLQueryItem] = [
370370
NSURLQueryItem(name: "foo", value: nil),
371371
NSURLQueryItem(name: "bar", value: nil),

Diff for: Darwin/Foundation-swiftoverlay/Data.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ internal func __NSDataIsCompact(_ data: NSData) -> Bool {
4545
@_implementationOnly import _CoreFoundationOverlayShims
4646

4747
internal func __NSDataIsCompact(_ data: NSData) -> Bool {
48-
if #available(OSX 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) {
48+
if #available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) {
4949
return data._isCompact()
5050
} else {
5151
var compact = true

Diff for: Darwin/Foundation-swiftoverlay/NSValue.swift

+18-18
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension NSRange: _ObjectiveCBridgeable {
2525
_getObjCTypeEncoding(NSRange.self)) == 0,
2626
"NSValue does not contain the right type to bridge to NSRange")
2727
result = NSRange()
28-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
28+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
2929
source.getValue(&result!, size: MemoryLayout<NSRange>.size)
3030
} else {
3131
source.getValue(&result!)
@@ -40,7 +40,7 @@ extension NSRange: _ObjectiveCBridgeable {
4040
return false
4141
}
4242
result = NSRange()
43-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
43+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
4444
source.getValue(&result!, size: MemoryLayout<NSRange>.size)
4545
} else {
4646
source.getValue(&result!)
@@ -55,7 +55,7 @@ extension NSRange: _ObjectiveCBridgeable {
5555
_getObjCTypeEncoding(NSRange.self)) == 0,
5656
"NSValue does not contain the right type to bridge to NSRange")
5757
var result = NSRange()
58-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
58+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
5959
unwrappedSource.getValue(&result, size: MemoryLayout<NSRange>.size)
6060
} else {
6161
unwrappedSource.getValue(&result)
@@ -77,7 +77,7 @@ extension CGRect: _ObjectiveCBridgeable {
7777
_getObjCTypeEncoding(CGRect.self)) == 0,
7878
"NSValue does not contain the right type to bridge to CGRect")
7979
result = CGRect()
80-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
80+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
8181
source.getValue(&result!, size: MemoryLayout<CGRect>.size)
8282
} else {
8383
source.getValue(&result!)
@@ -92,7 +92,7 @@ extension CGRect: _ObjectiveCBridgeable {
9292
return false
9393
}
9494
result = CGRect()
95-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
95+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
9696
source.getValue(&result!, size: MemoryLayout<CGRect>.size)
9797
} else {
9898
source.getValue(&result!)
@@ -107,7 +107,7 @@ extension CGRect: _ObjectiveCBridgeable {
107107
_getObjCTypeEncoding(CGRect.self)) == 0,
108108
"NSValue does not contain the right type to bridge to CGRect")
109109
var result = CGRect()
110-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
110+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
111111
unwrappedSource.getValue(&result, size: MemoryLayout<CGRect>.size)
112112
} else {
113113
unwrappedSource.getValue(&result)
@@ -129,7 +129,7 @@ extension CGPoint: _ObjectiveCBridgeable {
129129
_getObjCTypeEncoding(CGPoint.self)) == 0,
130130
"NSValue does not contain the right type to bridge to CGPoint")
131131
result = CGPoint()
132-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
132+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
133133
source.getValue(&result!, size: MemoryLayout<CGPoint>.size)
134134
} else {
135135
source.getValue(&result!)
@@ -144,7 +144,7 @@ extension CGPoint: _ObjectiveCBridgeable {
144144
return false
145145
}
146146
result = CGPoint()
147-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
147+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
148148
source.getValue(&result!, size: MemoryLayout<CGPoint>.size)
149149
} else {
150150
source.getValue(&result!)
@@ -159,7 +159,7 @@ extension CGPoint: _ObjectiveCBridgeable {
159159
_getObjCTypeEncoding(CGPoint.self)) == 0,
160160
"NSValue does not contain the right type to bridge to CGPoint")
161161
var result = CGPoint()
162-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
162+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
163163
unwrappedSource.getValue(&result, size: MemoryLayout<CGPoint>.size)
164164
} else {
165165
unwrappedSource.getValue(&result)
@@ -181,7 +181,7 @@ extension CGVector: _ObjectiveCBridgeable {
181181
_getObjCTypeEncoding(CGVector.self)) == 0,
182182
"NSValue does not contain the right type to bridge to CGVector")
183183
result = CGVector()
184-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
184+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
185185
source.getValue(&result!, size: MemoryLayout<CGVector>.size)
186186
} else {
187187
source.getValue(&result!)
@@ -196,7 +196,7 @@ extension CGVector: _ObjectiveCBridgeable {
196196
return false
197197
}
198198
result = CGVector()
199-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
199+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
200200
source.getValue(&result!, size: MemoryLayout<CGVector>.size)
201201
} else {
202202
source.getValue(&result!)
@@ -211,7 +211,7 @@ extension CGVector: _ObjectiveCBridgeable {
211211
_getObjCTypeEncoding(CGVector.self)) == 0,
212212
"NSValue does not contain the right type to bridge to CGVector")
213213
var result = CGVector()
214-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
214+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
215215
unwrappedSource.getValue(&result, size: MemoryLayout<CGVector>.size)
216216
} else {
217217
unwrappedSource.getValue(&result)
@@ -233,7 +233,7 @@ extension CGSize: _ObjectiveCBridgeable {
233233
_getObjCTypeEncoding(CGSize.self)) == 0,
234234
"NSValue does not contain the right type to bridge to CGSize")
235235
result = CGSize()
236-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
236+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
237237
source.getValue(&result!, size: MemoryLayout<CGSize>.size)
238238
} else {
239239
source.getValue(&result!)
@@ -248,7 +248,7 @@ extension CGSize: _ObjectiveCBridgeable {
248248
return false
249249
}
250250
result = CGSize()
251-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
251+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
252252
source.getValue(&result!, size: MemoryLayout<CGSize>.size)
253253
} else {
254254
source.getValue(&result!)
@@ -263,7 +263,7 @@ extension CGSize: _ObjectiveCBridgeable {
263263
_getObjCTypeEncoding(CGSize.self)) == 0,
264264
"NSValue does not contain the right type to bridge to CGSize")
265265
var result = CGSize()
266-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
266+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
267267
unwrappedSource.getValue(&result, size: MemoryLayout<CGSize>.size)
268268
} else {
269269
unwrappedSource.getValue(&result)
@@ -285,7 +285,7 @@ extension CGAffineTransform: _ObjectiveCBridgeable {
285285
_getObjCTypeEncoding(CGAffineTransform.self)) == 0,
286286
"NSValue does not contain the right type to bridge to CGAffineTransform")
287287
result = CGAffineTransform()
288-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
288+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
289289
source.getValue(&result!, size: MemoryLayout<CGAffineTransform>.size)
290290
} else {
291291
source.getValue(&result!)
@@ -300,7 +300,7 @@ extension CGAffineTransform: _ObjectiveCBridgeable {
300300
return false
301301
}
302302
result = CGAffineTransform()
303-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
303+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
304304
source.getValue(&result!, size: MemoryLayout<CGAffineTransform>.size)
305305
} else {
306306
source.getValue(&result!)
@@ -315,7 +315,7 @@ extension CGAffineTransform: _ObjectiveCBridgeable {
315315
_getObjCTypeEncoding(CGAffineTransform.self)) == 0,
316316
"NSValue does not contain the right type to bridge to CGAffineTransform")
317317
var result = CGAffineTransform()
318-
if #available(OSX 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
318+
if #available(macOS 10.13, iOS 11.0, tvOS 11.0, watchOS 4.0, *) {
319319
unwrappedSource.getValue(&result, size: MemoryLayout<CGAffineTransform>.size)
320320
} else {
321321
unwrappedSource.getValue(&result)

Diff for: Sources/Foundation/Data.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ import _SwiftFoundationOverlayShims
7575
import _SwiftCoreFoundationOverlayShims
7676

7777
internal func __NSDataIsCompact(_ data: NSData) -> Bool {
78-
if #available(OSX 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) {
78+
if #available(macOS 10.10, iOS 8.0, tvOS 9.0, watchOS 2.0, *) {
7979
return data._isCompact()
8080
} else {
8181
var compact = true

Diff for: Sources/Foundation/FileManager+POSIX.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension FileManager {
4949
return urls
5050
}
5151

52-
if #available(OSX 10.13, *) {
52+
if #available(macOS 10.13, *) {
5353
var statBufPtr: UnsafeMutablePointer<statfs>?
5454
let fsCount = getmntinfo_r_np(&statBufPtr, MNT_WAIT)
5555
guard let statBuf = statBufPtr, fsCount > 0 else {

Diff for: Sources/Foundation/JSONEncoder.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ extension JSONValue {
10101010
}
10111011
bytes.append(._closebracket)
10121012
case .object(let dict):
1013-
if #available(OSX 10.13, *), options.contains(.sortedKeys) {
1013+
if #available(macOS 10.13, *), options.contains(.sortedKeys) {
10141014
let sorted = dict.sorted { $0.key < $1.key }
10151015
self.writeObject(sorted, into: &bytes)
10161016
} else {
@@ -1072,7 +1072,7 @@ extension JSONValue {
10721072
self.addInset(to: &bytes, depth: depth)
10731073
bytes.append(._closebracket)
10741074
case .object(let dict):
1075-
if #available(OSX 10.13, *), options.contains(.sortedKeys) {
1075+
if #available(macOS 10.13, *), options.contains(.sortedKeys) {
10761076
let sorted = dict.sorted { $0.key < $1.key }
10771077
self.writePrettyObject(sorted, into: &bytes, depth: depth)
10781078
} else {

Diff for: Tests/Foundation/Tests/TestJSONEncoder.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ class TestJSONEncoder : XCTestCase {
130130
_testRoundTrip(of: person, expectedJSON: expectedJSON, outputFormatting: [.prettyPrinted])
131131

132132
let encoder = JSONEncoder()
133-
if #available(OSX 10.13, *) {
133+
if #available(macOS 10.13, *) {
134134
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
135135
} else {
136136
// Fallback on earlier versions
@@ -942,7 +942,7 @@ class TestJSONEncoder : XCTestCase {
942942

943943
func test_OutputFormattingValues() {
944944
XCTAssertEqual(JSONEncoder.OutputFormatting.prettyPrinted.rawValue, 1)
945-
if #available(OSX 10.13, *) {
945+
if #available(macOS 10.13, *) {
946946
XCTAssertEqual(JSONEncoder.OutputFormatting.sortedKeys.rawValue, 2)
947947
}
948948
XCTAssertEqual(JSONEncoder.OutputFormatting.withoutEscapingSlashes.rawValue, 8)

0 commit comments

Comments
 (0)