Skip to content

Commit 1eade54

Browse files
committed
SIL: correct the definition of SwiftInt
`Int` in Swift is defined to be `intptr_t`. `long` is equivalent, but not portable as it relies on `LP64` which is not guaranteed (Windows is LLP64, not LP64). This corrects the definition to be more portable.
1 parent 127874e commit 1eade54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/swift/SIL/SILBridging.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@ typedef enum {
141141
MayHaveSideEffectsBehavior
142142
} BridgedMemoryBehavior;
143143

144-
typedef long SwiftInt;
144+
145+
typedef intptr_t SwiftInt;
145146

146147
void registerBridgedClass(BridgedStringRef className, SwiftMetatype metatype);
147148

0 commit comments

Comments
 (0)