From 36a8a00dfa9c95cec71a2d4e03d0793aeb7ed0af Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 28 Jun 2000 23:01:00 +0000 Subject: [PATCH] (GUILE::create_function): Warn to stderr for and do not wrap functions with more than ten arguments. Thanks to Matthias Koeppe. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@507 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules1.1/guile.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Modules1.1/guile.cxx b/Source/Modules1.1/guile.cxx index 070753bd0..15aa005bd 100644 --- a/Source/Modules1.1/guile.cxx +++ b/Source/Modules1.1/guile.cxx @@ -620,9 +620,18 @@ GUILE::create_function (char *name, char *iname, DataType *d, ParmList *l) f.print (f_wrappers); - // Now register the function - fprintf (f_init, "\t gh_new_procedure(\"%s\", %s, %d, %d, 0);\n", - proc_name.get(), wname, numargs-numopt, numopt); + if (numargs > 10) { + // Guile would complain: too many args + fprintf(stderr, + "%s : Line %d. Warning. Too many arguments in Guile wrapper " + "for function %s (max. 10).\n", + input_file, line_number, name); + } + else { + // Now register the function + fprintf (f_init, "\t gh_new_procedure(\"%s\", %s, %d, %d, 0);\n", + proc_name.get(), wname, numargs-numopt, numopt); + } } // -----------------------------------------------------------------------