pkgsrc/devel/edcommon/patches/patch-ae

43 lines
1.3 KiB
Text

$NetBSD: patch-ae,v 1.1 2012/10/22 22:35:53 rh Exp $
Make this compile with libobjc2.
--- FoundationExtensions.subproj/NSObject+Extensions.m.orig 2003-01-25 22:33:49.000000000 +0000
+++ FoundationExtensions.subproj/NSObject+Extensions.m
@@ -117,12 +117,12 @@ BOOL EDClassIsSuperclassOfClass(Class aC
{
Class class;
- class = subClass->super_class;
+ class = class_getSuperclass(subClass);
while(class != nil)
{
if(class == aClass)
return YES;
- class = class->super_class;
+ class = class_getSuperclass(class);
}
return NO;
}
@@ -175,12 +175,17 @@ NSArray *EDSubclassesOfClass(Class aClas
NSMutableArray *subclasses;
Class subClass;
void *es = NULL;
+ int numClasses = 0, i;
+ Class *classes = objc_copyClassList(&numClasses);
subclasses = [NSMutableArray array];
- while((subClass = objc_next_class(&es)) != Nil)
- if(EDClassIsSuperclassOfClass(aClass, subClass) == YES)
- [subclasses addObject:subClass];
-
+ if (classes)
+ {
+ for (i = 0; i < numClasses; i++)
+ if(EDClassIsSuperclassOfClass(aClass, classes[i]) == YES)
+ [subclasses addObject: classes[i]];
+ free(classes);
+ }
return subclasses;
#endif
}