diff options
author | Matthias Köppe <mkoeppe@mail.math.uni-magdeburg.de> | 2000-08-30 21:53:49 +0000 |
---|---|---|
committer | Matthias Köppe <mkoeppe@mail.math.uni-magdeburg.de> | 2000-08-30 21:53:49 +0000 |
commit | d5431492ae2f7f7e72055fc687564c0b2330686e (patch) | |
tree | 1e041bd0809819011e0645ab3681eb46f95b3021 /Source | |
parent | c883555fb3d8a1cff14012edae5576dd07c3431f (diff) | |
download | swig-d5431492ae2f7f7e72055fc687564c0b2330686e.tar.gz |
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
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules1.1/guile.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
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. */ |