quakeforge/tools/qfcc/test/chewed-alias.r
Bill Currie b668759b7d [qfcc] Add a very basic attribute system
Ruamoko passes va_list (@args) through the ... parameter (as such), but
IMP uses ... to defeat parameter type and count checking and doesn't
want va_list. While possibly not the best solution, adding a no_va_list
flag to function types and skipping ex_args entirely does take care of
the problem without hard-coding anything specific to IMP.

The system currently just sets some bits in the type specifier (the
attribute list should probably be carried around with the specifier),
but it gets the job done for now, and at least gets things started.
2022-02-02 23:51:37 +09:00

28 lines
602 B
R

@interface Array
-count;
-lastObject;
@end
@interface Object
@end
@static entity waypoint_thinker;
@static Array *waypoint_queue;
void foo (void)
{
if ([waypoint_queue count]
&& (waypoint_thinker.@this = [waypoint_queue lastObject])) {
waypoint_thinker = nil; // just to deconfuse the dot graphs
}
}
int main ()
{
return 0; // test succeeds if compile succeeds
}
@attribute(no_va_list) id obj_msgSend (id receiver, SEL op, ...) = #0;
void __obj_exec_class (struct obj_module *msg) = #0;
@implementation Object
@end
@implementation Array
-count { return self; }
-lastObject { return nil; }
@end