vararg support for Java and C#

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4575 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2003-03-19 20:44:33 +00:00
commit 53f8457aa6
4 changed files with 52 additions and 4 deletions

View file

@ -554,7 +554,6 @@ class JAVA : public Language {
/* Get number of required and total arguments */
num_arguments = emit_num_arguments(l);
num_required = emit_num_required(l);
int gencomma = 0;
// Now walk the function parameter list and generate code to get arguments
@ -1314,11 +1313,19 @@ class JAVA : public Language {
if (!static_flag)
Printv(nativecall, "swigCPtr", NIL);
emit_mark_varargs(l);
int gencomma = !static_flag;
/* Output each parameter */
for (i = 0, p=l; p; i++) {
/* Ignored varargs */
if (checkAttribute(p,"varargs:ignore","1")) {
p = nextSibling(p);
continue;
}
/* Ignored parameters */
if (checkAttribute(p,"tmap:in:numinputs","0")) {
p = Getattr(p,"tmap:in:next");
@ -1417,11 +1424,19 @@ class JAVA : public Language {
Swig_typemap_attach_parms("jstype", l, NULL);
Swig_typemap_attach_parms("javain", l, NULL);
emit_mark_varargs(l);
int gencomma = 0;
/* Output each parameter */
for (i = 0, p=l; p; i++) {
/* Ignored varargs */
if (checkAttribute(p,"varargs:ignore","1")) {
p = nextSibling(p);
continue;
}
/* Ignored parameters */
if (checkAttribute(p,"tmap:in:numinputs","0")) {
p = Getattr(p,"tmap:in:next");