harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit c8afc8da0a547f26eb954818faae78a27309e7f6
parent 12547d0f9e0288be03f1c8a6b9c9980622bbec56
Author: Drew DeVault <sir@cmpwn.com>
Date:   Mon,  1 Feb 2021 19:03:38 -0500

typedefs: fix variadic function declarations

Diffstat:
Msrc/typedef.c | 10+++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/typedef.c b/src/typedef.c @@ -281,9 +281,17 @@ emit_decl_func(struct declaration *decl, FILE *out) for (struct type_func_param *param = fntype->func.params; param; param = param->next) { - emit_type(param->type, out); if (param->next) { + emit_type(param->type, out); fprintf(out, ", "); + } else if (fntype->func.variadism == VARIADISM_HARE) { + emit_type(param->type->array.members, out); + fprintf(out, "..."); + } else if (fntype->func.variadism == VARIADISM_C) { + emit_type(param->type, out); + fprintf(out, ", ..."); + } else { + emit_type(param->type, out); } }