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 2222#include < objc/runtime.h>
2323#include < objc/message.h>
2424#include < objc/objc.h>
25+ #if __has_include(<objc/objc-internal.h>)
26+ #include < objc/objc-internal.h>
27+ #endif
2528#endif
2629#include " llvm/ADT/StringRef.h"
2730#include " swift/Basic/Lazy.h"
@@ -1474,11 +1477,11 @@ static bool usesNativeSwiftReferenceCounting_nonNull(
14741477}
14751478
14761479#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.
14791480static bool isUniquelyReferenced (id object) {
14801481#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));
14821485#else
14831486 auto objcIsUniquelyRefd = SWIFT_LAZY_CONSTANT (reinterpret_cast <bool (*)(id )>(
14841487 dlsym (RTLD_NEXT, " objc_isUniquelyReferenced" )));
You can’t perform that action at this time.
0 commit comments