Re: Forwarding to Super
Re: Forwarding to Super
- Subject: Re: Forwarding to Super
- From: Herr Witten <email@hidden>
- Date: Fri, 23 Jul 2004 13:16:49 -0400
Sorry to beat a decaying horse, but I found that the return value was
not correct with the original code. This new code, however, works:
id _imp_proxy(id theReceiver, SEL theSelector, ...)
{
struct objc_super superContext;
superContext.receiver = theReceiver;
superContext.class = [theReceiver superclass];
void* args = __builtin_apply_args();
void* ptr = &superContext;
memmove((int*)args + 1, &ptr, sizeof(int*));
_method->method_imp = _method_imp_old;
//Don't use __builtin_return
id result = *((id*)__builtin_apply((void(*)())objc_msgSendSuper, args,
method_getSizeOfArguments(_method)));
return result;
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.