1 /* See if -forward::/-performv:: is able to work. */
6 #import "../../objc-obj-c++-shared/Object1.h"
7 #import "../../objc-obj-c++-shared/next-mapping.h"
8 #include <objc/objc-api.h>
10 #define VALUETOUSE 1234567890
12 id forwarder, receiver;
14 @interface Forwarder: Object
19 -initWithReceiver:theReceiver;
23 @interface Receiver:Object
28 -initWithFoo:(int)theFoo;
30 @implementation Receiver
32 -initWithFoo: (int)theFoo
40 /* Check to see if we are really the reciever. */
43 /* And the value of foo is set correctly. */
44 if (foo != VALUETOUSE)
51 @implementation Forwarder
52 -initWithReceiver: theReceiver
55 receiver = theReceiver;
58 #ifdef __NEXT_RUNTIME__
59 - forward: (SEL)theSel: (marg_list)theArgFrame
61 -(retval_t) forward: (SEL)theSel: (arglist_t)theArgFrame
64 /* If we have a reciever try to perform on that object */
66 return [receiver performv: theSel: theArgFrame];
67 return [self doesNotRecognize:theSel];
72 /* Init the reciever. */
73 receiver = [[Receiver alloc] initWithFoo: VALUETOUSE];
74 /* Init the fowarder. */
75 forwarder = [[Forwarder alloc] initWithReceiver: receiver];
76 /* Call display on the forwarder which in turns calls display on