X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tools%2Fprotoparse.h;h=4a1b0a0ce0ac57b48c19ec2b6c7681517d91724b;hb=7ba45c344765db59116cae21972f2ea5facf3815;hp=01f2e092aef535b49c3c8131083713a7ecdfb7d6;hpb=64c59faf96cd35319a5c7a11c5f47ee684b27ae2;p=ia32rtools.git diff --git a/tools/protoparse.h b/tools/protoparse.h index 01f2e09..4a1b0a0 100644 --- a/tools/protoparse.h +++ b/tools/protoparse.h @@ -17,6 +17,7 @@ struct parsed_proto { int argc_reg; unsigned int is_func:1; unsigned int is_stdcall:1; + unsigned int is_vararg:1; unsigned int is_fptr:1; unsigned int is_array:1; }; @@ -354,6 +355,18 @@ static int parse_protostr(char *protostr, struct parsed_proto *pp) if (*p == ',') p = sskip(p + 1); + if (!strncmp(p, "...", 3)) { + pp->is_vararg = 1; + p = sskip(p + 3); + if (*p == ')') { + p++; + break; + } + printf("%s:%d:%ld: ')' expected\n", + hdrfn, hdrfline, (p - protostr) + 1); + return -1; + } + arg = &pp->arg[xarg]; xarg++; @@ -418,6 +431,11 @@ static int parse_protostr(char *protostr, struct parsed_proto *pp) pp->arg[1].reg = strdup("edx"); } + if (pp->is_vararg && pp->is_stdcall) { + printf("%s:%d: vararg stdcall?\n", hdrfn, hdrfline); + return -1; + } + pp->argc = xarg; for (i = 0; i < pp->argc; i++) {