1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
--- gridlock.app-1.10.orig/EDObjcRuntime.h
+++ gridlock.app-1.10/EDObjcRuntime.h
@@ -44,16 +44,15 @@
#else /* GNU_RUNTIME */
-#import <objc/objc.h>
-#import <objc/objc-api.h>
+#import <objc/runtime.h>
#define EDObjcMsgSend(obj, sel) objc_msg_lookup((obj), (sel))((obj), (sel))
#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 EDObjcClassGetInstanceMethod class_get_instance_method
-#define EDObjcClassGetClassMethod class_get_class_method
+#define EDObjcMethodInfo Method
+#define EDObjcClassGetInstanceMethod class_getInstanceMethod
+#define EDObjcClassGetClassMethod class_getClassMethod
#endif
--- gridlock.app-1.10.orig/NSObject+Extensions.m
+++ gridlock.app-1.10/NSObject+Extensions.m
@@ -173,13 +173,16 @@ NSArray *EDSubclassesOfClass(Class aClas
#endif
#else /* GNU_RUNTIME */
NSMutableArray *subclasses;
- Class subClass;
- void *es = NULL;
+ Class *classes;
+ int i, numClasses;
subclasses = [NSMutableArray array];
- while((subClass = objc_next_class(&es)) != Nil)
- if(EDClassIsSuperclassOfClass(aClass, subClass) == YES)
- [subclasses addObject:subClass];
+ numClasses = objc_getClassList(NULL, 0);
+ classes = (Class *)NSZoneMalloc(NULL, numClasses * sizeof(Class));
+ numClasses = objc_getClassList(classes, numClasses);
+ for (i = 0; i < numClasses; i++)
+ [subclasses addObject:classes[i]];
+ NSZoneFree(NULL, classes);
return subclasses;
#endif
|