#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