How to redirect variadic function parameters?
Anders F Björklund
afb at algonet.se
Mon Feb 19 00:05:34 PST 2007
Bill Baxter wrote:
> You have to create a different, non-variadic function that takes
> _arguments and _argptr as arguments.
>
> See for example writefx in phobos/std/stdio.d:
> void writefx(FILE* fp,
> TypeInfo[] arguments, void* argptr,
> int newline=false);
The portable version uses "std.stdarg.va_list" instead:
void writefx(FILE* fp, TypeInfo[] arguments, va_list argptr, int
newline=false);
Should be the same for DMD, but is a built-in for GDC.
(need to use va_arg, instead of pointer manipulations)
--anders
http://www.prowiki.org/wiki4d/wiki.cgi?DocComments/Function#PortabilityandVariadicFunctions
More information about the Digitalmars-d-learn
mailing list