Skip to content

Commit 302fe96

Browse files
committed
Fix some Linux inconsistencies with swift_*weak runtime functions
Some of these return void * on platforms with Objective-C interop, but drops the return value on those without, such as on Linux.
1 parent 10c44e1 commit 302fe96

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/swift/Runtime/HeapObject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ extern "C" void *swift_unknownWeakLoadStrong(WeakReference *ref);
899899

900900
#else
901901

902-
static inline void swift_unknownWeakLoadStrong(WeakReference *ref) {
903-
swift_weakLoadStrong(ref);
902+
static inline void *swift_unknownWeakLoadStrong(WeakReference *ref) {
903+
return static_cast<void *>(swift_weakLoadStrong(ref));
904904
}
905905

906906
#endif /* SWIFT_OBJC_INTEROP */
@@ -918,8 +918,8 @@ extern "C" void *swift_unknownWeakTakeStrong(WeakReference *ref);
918918

919919
#else
920920

921-
static inline void swift_unknownWeakTakeStrong(WeakReference *ref) {
922-
swift_weakTakeStrong(ref);
921+
static inline void *swift_unknownWeakTakeStrong(WeakReference *ref) {
922+
return static_cast<void *>(swift_weakTakeStrong(ref));
923923
}
924924

925925
#endif /* SWIFT_OBJC_INTEROP */

0 commit comments

Comments
 (0)