%varargs - better documentation and remove additional argument generation which didn't work properly as a sentinel
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12666 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6e87b73c40
commit
74aa3f218f
4 changed files with 57 additions and 16 deletions
|
|
@ -2627,10 +2627,15 @@ varargs_parms : parms { $$ = $1; }
|
|||
Swig_error(cparse_file, cparse_line,"Argument count in %%varargs must be positive.\n");
|
||||
$$ = 0;
|
||||
} else {
|
||||
String *name = Getattr($3, "name");
|
||||
$$ = Copy($3);
|
||||
Setattr($$,"name","VARARGS_SENTINEL");
|
||||
for (i = 0; i < n; i++) {
|
||||
if (name)
|
||||
Setattr($$, "name", NewStringf("%s%d", name, n));
|
||||
for (i = 1; i < n; i++) {
|
||||
p = Copy($3);
|
||||
name = Getattr(p, "name");
|
||||
if (name)
|
||||
Setattr(p, "name", NewStringf("%s%d", name, n-i));
|
||||
set_nextSibling(p,$$);
|
||||
Delete($$);
|
||||
$$ = p;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue