Skip to content

Commit 76c5fac

Browse files
committed
[Apple Silicon] [ObjectiveC Overlay] ObjCBool is C _Bool on arm64 macOS.
1 parent 6c183c8 commit 76c5fac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

stdlib/public/Darwin/ObjectiveC/ObjectiveC.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import ObjectiveC
2525
/// ObjCBool.
2626
@frozen
2727
public struct ObjCBool : ExpressibleByBooleanLiteral {
28-
#if os(macOS) || (os(iOS) && (arch(i386) || arch(arm)))
29-
// On OS X and 32-bit iOS, Objective-C's BOOL type is a "signed char".
28+
#if (os(macOS) && arch(x86_64)) || (os(iOS) && (arch(i386) || arch(arm)))
29+
// On Intel OS X and 32-bit iOS, Objective-C's BOOL type is a "signed char".
3030
@usableFromInline var _value: Int8
3131

3232
@_transparent
@@ -52,7 +52,7 @@ public struct ObjCBool : ExpressibleByBooleanLiteral {
5252
/// The value of `self`, expressed as a `Bool`.
5353
@_transparent
5454
public var boolValue: Bool {
55-
#if os(macOS) || (os(iOS) && (arch(i386) || arch(arm)))
55+
#if (os(macOS) && arch(x86_64)) || (os(iOS) && (arch(i386) || arch(arm)))
5656
return _value != 0
5757
#else
5858
return _value

test/IRGen/Inputs/ObjectiveC.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
@_exported import ObjectiveC
33

44
public struct ObjCBool : CustomStringConvertible {
5-
#if os(macOS) || (os(iOS) && (arch(i386) || arch(arm)))
5+
#if (os(macOS) && arch(x86_64)) || (os(iOS) && (arch(i386) || arch(arm) || targetEnvironment(macCatalyst)))
6+
67
// On macOS and 32-bit iOS, Objective-C's BOOL type is a "signed char".
78
private var value: Int8
89

0 commit comments

Comments
 (0)