File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 22
22
#include < objc/runtime.h>
23
23
#include < objc/message.h>
24
24
#include < objc/objc.h>
25
+ #if __has_include(<objc/objc-internal.h>)
26
+ #include < objc/objc-internal.h>
27
+ #endif
25
28
#endif
26
29
#include " llvm/ADT/StringRef.h"
27
30
#include " swift/Basic/Lazy.h"
@@ -1474,11 +1477,11 @@ static bool usesNativeSwiftReferenceCounting_nonNull(
1474
1477
}
1475
1478
1476
1479
#if SWIFT_OBJC_INTEROP
1477
- // It would be nice to weak link instead of doing this, but we can't do that
1478
- // until the new API is in the versions of libobjc that we're linking against.
1479
1480
static bool isUniquelyReferenced (id object) {
1480
1481
#if OBJC_ISUNIQUELYREFERENCED_DEFINED
1481
- return objc_isUniquelyReferenced (object);
1482
+ if (!SWIFT_RUNTIME_WEAK_CHECK (objc_isUniquelyReferenced))
1483
+ return false ;
1484
+ return SWIFT_RUNTIME_WEAK_USE (objc_isUniquelyReferenced (object));
1482
1485
#else
1483
1486
auto objcIsUniquelyRefd = SWIFT_LAZY_CONSTANT (reinterpret_cast <bool (*)(id )>(
1484
1487
dlsym (RTLD_NEXT, " objc_isUniquelyReferenced" )));
You can’t perform that action at this time.
0 commit comments