Skip to content

Commit 3e388b3

Browse files
authored
Merge pull request swiftlang#15087 from ikesyo/if-os-macos
[stdlib/public][gardening] Prefer `os(macOS)` over `os(OSX)`
2 parents ad40c77 + e5223e4 commit 3e388b3

File tree

8 files changed

+17
-18
lines changed

8 files changed

+17
-18
lines changed

stdlib/public/Platform/MachError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
13+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
1414
/// Enumeration describing Mach error codes.
1515
@_fixed_layout // FIXME(sil-serialize-all)
1616
@objc

stdlib/public/Platform/POSIXError.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// FIXME: Only defining POSIXErrorCode for Darwin and Linux at the moment.
1414

15-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
15+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
1616

1717
/// Enumeration describing POSIX error codes.
1818
@_fixed_layout // FIXME(sil-serialize-all)

stdlib/public/Platform/Platform.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import SwiftShims
1414

15-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
15+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
1616
//===----------------------------------------------------------------------===//
1717
// MacTypes.h
1818
//===----------------------------------------------------------------------===//
@@ -91,7 +91,7 @@ public var errno : Int32 {
9191
// stdio.h
9292
//===----------------------------------------------------------------------===//
9393

94-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) || os(FreeBSD) || os(PS4)
94+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(FreeBSD) || os(PS4)
9595
public var stdin : UnsafeMutablePointer<FILE> {
9696
get {
9797
return __stdinp
@@ -224,7 +224,7 @@ public var S_IFBLK: mode_t { return mode_t(0o060000) }
224224
public var S_IFREG: mode_t { return mode_t(0o100000) }
225225
public var S_IFLNK: mode_t { return mode_t(0o120000) }
226226
public var S_IFSOCK: mode_t { return mode_t(0o140000) }
227-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
227+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
228228
public var S_IFWHT: mode_t { return mode_t(0o160000) }
229229
#endif
230230

@@ -247,7 +247,7 @@ public var S_ISUID: mode_t { return mode_t(0o004000) }
247247
public var S_ISGID: mode_t { return mode_t(0o002000) }
248248
public var S_ISVTX: mode_t { return mode_t(0o001000) }
249249

250-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
250+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
251251
public var S_ISTXT: mode_t { return S_ISVTX }
252252
public var S_IREAD: mode_t { return S_IRUSR }
253253
public var S_IWRITE: mode_t { return S_IWUSR }
@@ -291,7 +291,7 @@ public func ioctl(
291291
// unistd.h
292292
//===----------------------------------------------------------------------===//
293293

294-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
294+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
295295
@available(*, unavailable, message: "Please use threads or posix_spawn*()")
296296
public func fork() -> Int32 {
297297
fatalError("unavailable function can't be called")
@@ -307,7 +307,7 @@ public func vfork() -> Int32 {
307307
// signal.h
308308
//===----------------------------------------------------------------------===//
309309

310-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
310+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
311311
public var SIG_DFL: sig_t? { return nil }
312312
public var SIG_IGN: sig_t { return unsafeBitCast(1, to: sig_t.self) }
313313
public var SIG_ERR: sig_t { return unsafeBitCast(-1, to: sig_t.self) }
@@ -357,7 +357,7 @@ internal var _ignore = _UnsupportedPlatformError()
357357
#if !os(Windows)
358358
/// The value returned by `sem_open()` in the case of failure.
359359
public var SEM_FAILED: UnsafeMutablePointer<sem_t>? {
360-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
360+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
361361
// The value is ABI. Value verified to be correct for OS X, iOS, watchOS, tvOS.
362362
return UnsafeMutablePointer<sem_t>(bitPattern: -1)
363363
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
@@ -392,7 +392,7 @@ public func sem_open(
392392
//===----------------------------------------------------------------------===//
393393

394394
// Some platforms don't have `extern char** environ` imported from C.
395-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) || os(FreeBSD) || os(PS4)
395+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(FreeBSD) || os(PS4)
396396
public var environ: UnsafeMutablePointer<UnsafeMutablePointer<CChar>?> {
397397
return _stdlib_getEnviron()
398398
}

stdlib/public/Platform/TiocConstants.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Tty ioctl request constants, needed only on Darwin and FreeBSD.
1414

1515
// Constants available on all platforms, also available on Linux.
16-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS) || os(FreeBSD) || os(Haiku)
16+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS) || os(FreeBSD) || os(Haiku)
1717

1818
/// Set exclusive use of tty.
1919
public var TIOCEXCL: UInt { return 0x2000740d }
@@ -115,7 +115,7 @@ public var TIOCGLTC: UInt { return 0x40067474 }
115115

116116

117117
// Darwin only constants, also available on Linux.
118-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
118+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
119119

120120
/// Get termios struct.
121121
public var TIOCGETA: UInt { return 0x40487413 }
@@ -174,4 +174,3 @@ public var TIOCPTMASTER: UInt { return 0x2000741c }
174174
public var TIOCGSID: UInt { return 0x40047463 }
175175

176176
#endif
177-

stdlib/public/Platform/tgmath.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public func ${ufunc}(_ x: ${T}) -> ${T} {
180180

181181
% end
182182

183-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
183+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
184184
// Unary intrinsic functions
185185
// Note these have a corresponding LLVM intrinsic
186186
% for T, ufunc in TypedUnaryIntrinsicFunctions():

stdlib/public/core/Availability.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public func _stdlib_isOSVersionAtLeast(
2424
_ minor: Builtin.Word,
2525
_ patch: Builtin.Word
2626
) -> Builtin.Int1 {
27-
#if os(OSX) || os(iOS) || os(tvOS) || os(watchOS)
27+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
2828
let runningVersion = _swift_stdlib_operatingSystemVersion()
2929
let queryVersion = _SwiftNSOperatingSystemVersion(
3030
majorVersion: Int(major),

stdlib/public/core/CTypes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public typealias CFloat = Float
6363
public typealias CDouble = Double
6464

6565
/// The C 'long double' type.
66-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
66+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
6767
// On Darwin, long double is Float80 on x86, and Double otherwise.
6868
#if arch(x86_64) || arch(i386)
6969
public typealias CLongDouble = Float80

stdlib/public/core/Codable.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,7 +1167,7 @@ public enum EncodingError : Error {
11671167
public var _userInfo: AnyObject? {
11681168
// The error dictionary must be returned as an AnyObject. We can do this
11691169
// only on platforms with bridging, unfortunately.
1170-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
1170+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
11711171
let context: Context
11721172
switch self {
11731173
case .invalidValue(_, let c): context = c
@@ -1278,7 +1278,7 @@ public enum DecodingError : Error {
12781278
public var _userInfo: AnyObject? {
12791279
// The error dictionary must be returned as an AnyObject. We can do this
12801280
// only on platforms with bridging, unfortunately.
1281-
#if os(OSX) || os(iOS) || os(watchOS) || os(tvOS)
1281+
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
12821282
let context: Context
12831283
switch self {
12841284
case .keyNotFound(_, let c): context = c

0 commit comments

Comments
 (0)