Skip to content

Commit 253e624

Browse files
committed
Basic: avoid truncation
`Swift.Int` is *NOT* `int` or `long`, it is `uintptr_t`. Unfortunately, we cannot include `stdint.h` here and thus cannot use `uintptr_t`. Perhaps we should consider using `__swift_uintptr_t`. For now, assume that we are always 64-bit and use `long long` and `unsigned long long` which repairs the builds with non-LP64 targets.
1 parent 5422f9a commit 253e624

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/swift/Basic/CBasicBridging.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ SWIFT_BEGIN_ASSUME_NONNULL
4040

4141
typedef struct BridgedData {
4242
const char *_Nullable baseAddress;
43-
unsigned long size;
43+
size_t size;
4444
} BridgedData;
4545

4646
void BridgedData_free(BridgedData data);

0 commit comments

Comments
 (0)