ensure $symname is suitably expanded

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9199 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-07-05 21:26:10 +00:00
commit d9d1a7d5c4
9 changed files with 24 additions and 1 deletions

View file

@ -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");

View file

@ -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");

View file

@ -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, ");

View file

@ -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 {

View file

@ -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")) {

View file

@ -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 ) {

View file

@ -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);

View file

@ -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);

View file

@ -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);