#construct a va_list and pass it to a c function
1 messages · Page 1 of 1 (latest)
You are not meant to create it from scratch
but get it from a function
pub fn someFunction(fmt: [*:0]u8, ...) callconv(.C) void {
var vaList = @cVaStart();
var copy = @cVaCopy(&vaList);
std.c.vprintf(fmt, copy);
@cVaEnd(&vaList);
}
Dunno if the copy is needed
buuut
yea
note this uses a variadic function definition, and that is only valid iirc from a C calling convention function
but what if i need to dynamically create one?
why would you need this