Implemented C variadic arguments

This commit is contained in:
Krzosa Karol
2023-04-14 22:22:34 +02:00
parent fdcdc8ea86
commit 8c4975db35
9 changed files with 74 additions and 15 deletions

View File

@@ -339,6 +339,10 @@ gen_lambda(Intern_String name, Ast_Lambda *lambda, B32 generate_block = true) {
gen("(");
if (lambda->args.len == 0) gen("void");
For(lambda->args) {
if (it->name == pctx->intern("..."_s)) {
gen("...");
continue;
}
gen_var(it, DONT_EMIT_VALUE, true);
if (&it != (lambda->args.end() - 1))
gen(", ");
@@ -935,6 +939,7 @@ compile_to_c_code() {
global_indent++;
For2(pctx->all_types, t) {
if (t->kind == TYPE_POLYMORPH) continue;
// if (t->kind == TYPE_VARGS) continue;
genln("{/*%Q*/", typestring(t));
global_indent += 1;