Add patches missing from previous commit

This commit is contained in:
rh 2012-10-22 22:35:53 +00:00
parent 36998cc69b
commit 0054999b4c
2 changed files with 58 additions and 0 deletions

View file

@ -0,0 +1,43 @@
$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
}

View file

@ -0,0 +1,15 @@
$NetBSD: patch-af,v 1.1 2012/10/22 22:35:53 rh Exp $
Make this compile with libobjc2.
--- EDObjcRuntime.h.orig 2003-01-25 22:33:43.000000000 +0000
+++ EDObjcRuntime.h
@@ -51,7 +51,7 @@
#define EDObjcMsgSend1(obj, sel, obj1) objc_msg_lookup((obj), (sel))((obj), (sel), (obj1))
#define EDObjcMsgSend2(obj, sel, obj1, obj2) objc_msg_lookup((obj), (sel))((obj), (sel), (obj1), (obj2))
#define EDObjcMsgSend3(obj, sel, obj1, obj2, obj3) objc_msg_lookup((obj), (sel))((obj), (sel), (obj1), (obj2), (obj3))
-#define EDObjcMethodInfo Method_t
+#define EDObjcMethodInfo Method
#define EDObjcClassGetInstanceMethod class_get_instance_method
#define EDObjcClassGetClassMethod class_get_class_method