ObjFW  Diff

Differences From Artifact [e9f75e8e35]:

To Artifact [6307d1d02a]:


11
12
13
14
15
16
17


18
19
20
21
22
23
24
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"



#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>
#endif








>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
 * Alternatively, it may be distributed under the terms of the GNU General
 * Public License, either version 2 or 3, which can be found in the file
 * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this
 * file.
 */

#include "config.h"

#include <stdlib.h>

#if defined(OF_APPLE_RUNTIME) || defined(OF_GNU_RUNTIME)
# import <objc/runtime.h>
#elif defined(OF_OLD_GNU_RUNTIME)
# import <objc/objc-api.h>
#endif

112
113
114
115
116
117
118

119
120
121

122
123


124

125

126
127
128

129



130
131
132
133
134
135
136
		unsigned i, count;

		classMethods = [[OFMutableArray alloc] init];
		instanceMethods = [[OFMutableArray alloc] init];

		methodList = class_copyMethodList(((OFObject*)class)->isa,
		    &count);

		for (i = 0; i < count; i++) {
			[classMethods addObject: [[[OFMethod alloc]
			    _initWithMethod: methodList[i]] autorelease]];

			[pool releaseObjects];
		}




		methodList = class_copyMethodList(class, &count);

		for (i = 0; i < count; i++) {
			[instanceMethods addObject: [[[OFMethod alloc]
			    _initWithMethod: methodList[i]] autorelease]];

			[pool releaseObjects];



		}
#elif defined(OF_OLD_GNU_RUNTIME)
		MethodList_t methodList;

		classMethods = [[OFMutableArray alloc] init];
		instanceMethods = [[OFMutableArray alloc] init];








>
|
|
|
>
|
|
>
>
|
>

>
|
|
|
>
|
>
>
>







114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
		unsigned i, count;

		classMethods = [[OFMutableArray alloc] init];
		instanceMethods = [[OFMutableArray alloc] init];

		methodList = class_copyMethodList(((OFObject*)class)->isa,
		    &count);
		@try {
			for (i = 0; i < count; i++) {
				[classMethods addObject: [[[OFMethod alloc]
				    _initWithMethod: methodList[i]]
				    autorelease]];
				[pool releaseObjects];
			}
		} @finally {
			free(methodList);
		}

		methodList = class_copyMethodList(class, &count);
		@try {
			for (i = 0; i < count; i++) {
				[instanceMethods addObject: [[[OFMethod alloc]
				    _initWithMethod: methodList[i]]
				    autorelease]];
				[pool releaseObjects];
			}
		} @finally {
			free(methodList);
		}
#elif defined(OF_OLD_GNU_RUNTIME)
		MethodList_t methodList;

		classMethods = [[OFMutableArray alloc] init];
		instanceMethods = [[OFMutableArray alloc] init];