ObjFW  Diff

Differences From Artifact [4bc8df336e]:

To Artifact [95a9dc34dd]:


224
225
226
227
228
229
230
231
232
233


234
235
236
237
238
239
240
241
242
243
244
224
225
226
227
228
229
230



231
232




233
234
235
236
237
238
239







-
-
-
+
+
-
-
-
-







#endif
}

+ (IMP)setImplementation: (IMP)newimp
	  forClassMethod: (SEL)selector
{
#ifdef OF_APPLE_RUNTIME
	Method method;

	if ((method = class_getClassMethod(self, selector)) == NULL)
	return class_replaceMethod(self->isa, selector, newimp,
	    method_getTypeEncoding(class_getClassMethod(self, selector)));
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	return method_setImplementation(method, newimp);
#else
	Method_t method;
	IMP oldimp;

	/* The class method is the instance method of the meta class */
	if ((method = class_get_instance_method(self->class_pointer,
	    selector)) == NULL)
279
280
281
282
283
284
285
286
287
288


289
290
291
292
293
294
295
296
297
298
299
274
275
276
277
278
279
280



281
282




283
284
285
286
287
288
289







-
-
-
+
+
-
-
-
-







			forClassMethod: selector];
}

+ (IMP)setImplementation: (IMP)newimp
       forInstanceMethod: (SEL)selector
{
#ifdef OF_APPLE_RUNTIME
	Method method;

	if ((method = class_getInstanceMethod(self, selector)) == NULL)
	return class_replaceMethod(self, selector, newimp,
	    method_getTypeEncoding(class_getInstanceMethod(self, selector)));
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];

	return method_setImplementation(method, newimp);
#else
	Method_t method = class_get_instance_method(self, selector);
	IMP oldimp;

	if (method == NULL)
		@throw [OFInvalidArgumentException newWithClass: self
						       selector: _cmd];