File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,15 @@ static uintptr_t computeISAMask() {
7979#endif
8080}
8181
82+ #if SWIFT_OBJC_INTEROP
83+ // / \brief Replacement for ObjC object_isClass(), which is unavailable on
84+ // / deployment targets macOS 10.9 and iOS 7.
85+ static bool objcObjectIsClass (id object) {
86+ // same as object_isClass(object)
87+ return class_isMetaClass (object_getClass (object));
88+ }
89+ #endif
90+
8291// / \brief Fetch the type metadata associated with the formal dynamic
8392// / type of the given (possibly Objective-C) object. The formal
8493// / dynamic type ignores dynamic subclasses such as those introduced
@@ -105,7 +114,7 @@ static uintptr_t computeISAMask() {
105114
106115 id objcObject = reinterpret_cast <id >(object);
107116 Class objcClass = [objcObject class ];
108- if (object_isClass (objcObject)) {
117+ if (objcObjectIsClass (objcObject)) {
109118 // Original object is a class. We want a
110119 // metaclass but +class doesn't give that to us.
111120 objcClass = object_getClass (objcClass);
You can’t perform that action at this time.
0 commit comments