On 28/08/11 12:23, Matt Rice wrote:
Thanks, is there a msg_send_compat.h which was supposed to be included
with this patch?
Indeed, here is the file. All tests were done with revision #2606.
I also have a complete example that I could send which shows SOGo
(www.sogo.nu) instantiating and class and invoking a method which is
provided by a Python script (class definition and the implementation of
that method).
Regards,
#ifndef __APPLE__
/*
* In the Apple runtimes, objc_msgSend() and objc_msgSendSuper() are
* trampolines that should be cast to the type of the IMP and then called.
*
* The GNU runtimes do not have these trampolines. When sending a message with
* one of these runtimes, you must call objc_msg_lookup[_super]() and then call
* the returned function pointer. We define a set of trampolines for the
* correct types here, and #define them all back to the runtime-provided
* trampoline for the Mac runtimes.
*/
static IMP objc_impMsgSendPtr(id obj, SEL _cmd, void *arg)
{
return ((IMP(*)(id,SEL,void*))objc_msg_lookup(obj, _cmd))(obj, _cmd,
arg);
}
static id objc_msgSendSuper(struct objc_super *super, SEL _cmd)
{
id obj = super->receiver;
return objc_msg_lookup_super(super, _cmd)(obj, _cmd);
}
static inline id objc_msgSendSuperPtr(struct objc_super *super, SEL _cmd, void
*arg)
{
id obj = super->receiver;
return objc_msg_lookup_super(super, _cmd)(obj, _cmd, arg);
}
static inline id objc_msgSendSuperPtrPtr(struct objc_super *super, SEL _cmd,
void *arg, void *arg2)
{
id obj = super->receiver;
return objc_msg_lookup_super(super, _cmd)(obj, _cmd, arg, arg2);
}
static IMP objc_impMsgSendSuperPtr(struct objc_super *super, SEL _cmd, void
*arg)
{
id obj = super->receiver;
return ((IMP(*)(id,SEL,void*))objc_msg_lookup_super(super, _cmd))(obj,
_cmd, arg);
}
static int objc_intMsgSendSuperPtr(struct objc_super *super, SEL _cmd, void
*arg)
{
id obj = super->receiver;
return ((int(*)(id,SEL,SEL))objc_msg_lookup_super(super, _cmd))(obj,
_cmd, arg);
}
# undef CLASS
#else
# define objc_impMsgSendPtr ((IMP(*)(id,SEL,SEL))objc_msgSend)
# define objc_msgSendSuperPtr objc_msgSendSuper
# define objc_msgSendSuperPtrPtr objc_msgSendSuper
# define objc_impMsgSendPtr ((IMP(*)(id,SEL,SEL))objc_msgSendSuper)
# define objc_intMsgSendSuperPtr ((int(*)(id,SEL,SEL))objc_msgSendSuper)
#endif
_______________________________________________
Discuss-gnustep mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep