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_OBJC_USE_NEW_INTERFACE
59 - forward: (SEL)theSel: (marg_list)theArgFrame
62 -(retval_t) forward: (SEL)theSel: (arglist_t)theArgFrame
65 /* If we have a reciever try to perform on that object */
67 return [receiver performv: theSel: theArgFrame];
68 return [self doesNotRecognize:theSel];
73 /* Init the reciever. */
74 receiver = [[Receiver alloc] initWithFoo: VALUETOUSE];
75 /* Init the fowarder. */
76 forwarder = [[Forwarder alloc] initWithReceiver: receiver];
77 /* Call display on the forwarder which in turns calls display on