From d5431492ae2f7f7e72055fc687564c0b2330686e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20K=C3=B6ppe?= Date: Wed, 30 Aug 2000 21:53:49 +0000 Subject: Fixed handling of char types. Added support for optional arguments. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@739 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules1.1/guile.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'Source') diff --git a/Source/Modules1.1/guile.cxx b/Source/Modules1.1/guile.cxx index f3c0f937f..26e4f5e33 100644 --- a/Source/Modules1.1/guile.cxx +++ b/Source/Modules1.1/guile.cxx @@ -474,6 +474,7 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l) int i; int numargs = 0; int numopt = 0; + int pcount = 0; // Make a wrapper name for this char * wname = new char [strlen (prefix) + strlen (iname) + 2]; @@ -484,7 +485,8 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l) Replace(proc_name,"_", "-", DOH_REPLACE_ANY); /* Emit locals etc. into f->code; figure out which args to ignore */ - emit_args (d, l, f); + pcount = emit_args (d, l, f); + numopt = check_numopt(l); /* Declare return variable */ @@ -516,6 +518,8 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l) else { if (numargs!=0) Printf(f->def,", "); Printf(f->def,"SCM s_%d", i); + if (i>=(pcount-numopt)) + Printf(f->code," if (s_%d != GH_NOT_PASSED) {\n", i); ++numargs; if (guile_do_typemap(f->code, "in", pt, pn, source, target, numargs, proc_name, f, 0)) { @@ -533,6 +537,8 @@ GUILE::create_function (char *name, char *iname, SwigType *d, ParmList *l) guile_do_doc_typemap(signature, "indoc", pt, pn, numargs, proc_name, f); } + if (i>=(pcount-numopt)) + Printf(f->code," }\n"); } /* Check if there are any constraints. */ -- cgit v1.2.1