diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index c5e398a8c..8df076127 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -939,6 +939,9 @@ class CSHARP : public Language { /* Substitute the cleanup code */ Replaceall(f->code,"$cleanup",cleanup); + /* Substitute the function name */ + Replaceall(f->code,"$symname",symname); + /* Contract macro modification */ if (Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert($null, ") > 0) { Setattr(n,"csharp:canthrow","1"); diff --git a/Source/Modules/guile.cxx b/Source/Modules/guile.cxx index 99c366e9f..ee563bffb 100644 --- a/Source/Modules/guile.cxx +++ b/Source/Modules/guile.cxx @@ -964,6 +964,8 @@ public: Printv(f->code, beforereturn, "\n", NIL); Printv(f->code, "return gswig_result;\n", NIL); + /* Substitute the function name */ + Replaceall(f->code,"$symname",iname); // Undefine the scheme name Printf(f->code, "#undef FUNC_NAME\n"); diff --git a/Source/Modules/java.cxx b/Source/Modules/java.cxx index 78671d7de..38c272c01 100644 --- a/Source/Modules/java.cxx +++ b/Source/Modules/java.cxx @@ -995,6 +995,9 @@ class JAVA : public Language { /* Substitute the cleanup code */ Replaceall(f->code,"$cleanup",cleanup); + /* Substitute the function name */ + Replaceall(f->code,"$symname",symname); + /* Contract macro modification */ Replaceall(f->code, "SWIG_contract_assert(", "SWIG_contract_assert($null, "); diff --git a/Source/Modules/modula3.cxx b/Source/Modules/modula3.cxx index 0fea8ec39..9cbccc202 100644 --- a/Source/Modules/modula3.cxx +++ b/Source/Modules/modula3.cxx @@ -1357,6 +1357,7 @@ MODULA3 (): Hash *throws_hash = NewHash (); ParmList *l = Getattr (n, "parms"); SwigType *t = Getattr (n, "type"); + String *symname = Getattr(n,"sym:name"); if (!Getattr (n, "sym:overloaded")) { if (!addSymbol (wname, n)) { @@ -1560,6 +1561,9 @@ MODULA3 (): /* Substitute the cleanup code */ Replaceall (f->code, "$cleanup", cleanup); + /* Substitute the function name */ + Replaceall(f->code,"$symname",symname); + if (!is_void_return) { Replaceall (f->code, "$null", "0"); } else { diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx index 45e1ccb75..e68bc0f6c 100644 --- a/Source/Modules/mzscheme.cxx +++ b/Source/Modules/mzscheme.cxx @@ -389,6 +389,9 @@ public: Printf(f->code, "#undef FUNC_NAME\n"); Printv(f->code, "}\n",NIL); + /* Substitute the function name */ + Replaceall(f->code,"$symname",iname); + Wrapper_print(f, f_wrappers); if (!Getattr(n,"sym:overloaded")) { diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index b93112bf7..276cd1a98 100755 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -749,6 +749,9 @@ public: tab4, "CAMLreturn(swig_result);\n", NIL ); Printv(f->code, "}\n",NIL); + /* Substitute the function name */ + Replaceall(f->code,"$symname",iname); + Wrapper_print(f, f_wrappers); if( isOverloaded ) { diff --git a/Source/Modules/php4.cxx b/Source/Modules/php4.cxx index 2c5d87825..92fb2b04d 100644 --- a/Source/Modules/php4.cxx +++ b/Source/Modules/php4.cxx @@ -1306,7 +1306,6 @@ public: Printf(f->code, "}\n"); - // These were cribbed from python.cxx Replaceall(f->code,"$cleanup",cleanup); Replaceall(f->code,"$symname",iname); diff --git a/Source/Modules/r.cxx b/Source/Modules/r.cxx index 2ae3b9f0c..ad0cc046d 100644 --- a/Source/Modules/r.cxx +++ b/Source/Modules/r.cxx @@ -2000,6 +2000,9 @@ int R::functionWrapper(Node *n) { Printv(f->code, "return r_ans;\n}\n", NIL); Printv(sfun->code, "\n}", NIL); + /* Substitute the function name */ + Replaceall(f->code,"$symname",iname); + Wrapper_print(f, f_wrapper); Wrapper_print(sfun, sfile); diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index 97ae0f35d..16a7f7cf6 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1322,6 +1322,9 @@ public: /* Substitute the cleanup code */ Replaceall(f->code,"$cleanup",cleanup); + /* Substitute the function name */ + Replaceall(f->code,"$symname",symname); + /* Emit the function */ Wrapper_print(f, f_wrappers);