From a503a53533bc79636588bddc3509fe03791d706e Mon Sep 17 00:00:00 2001 From: Marcelo Matus Date: Wed, 26 Oct 2005 07:12:29 +0000 Subject: [PATCH] add the swig version to the proxy file git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7729 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/perl5.cxx | 18 +++++++++++++++--- Source/Modules/tcl8.cxx | 3 +-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Source/Modules/perl5.cxx b/Source/Modules/perl5.cxx index 8028a74fa..1a4766a10 100644 --- a/Source/Modules/perl5.cxx +++ b/Source/Modules/perl5.cxx @@ -274,7 +274,11 @@ public: Delete(tmp); } - Printf(f_pm,"# This file was automatically generated by SWIG\n"); + Printv(f_pm, + "# This file was created automatically by SWIG ", PACKAGE_VERSION, ".\n", + "# Don't modify this file, modify the SWIG interface instead.\n", + NIL); + Printf(f_pm,"package %s;\n",fullmodule); Printf(f_pm,"require Exporter;\n"); @@ -636,9 +640,16 @@ public: num_saved = 0; for (i=0,p = l; p;i++) { if ((tm = Getattr(p,"tmap:argout"))) { + SwigType *t = Getattr(p,"type"); Replaceall(tm,"$source",Getattr(p,"lname")); Replaceall(tm,"$target","ST(argvi)"); Replaceall(tm,"$result","ST(argvi)"); + if (is_shadow(t)) { + Replaceall(tm, "$shadow", "SWIG_SHADOW"); + } else { + Replaceall(tm, "$shadow", "0"); + } + String *in = Getattr(p,"emit:input"); if (in) { sprintf(temp,"_saved[%d]", num_saved); @@ -709,8 +720,8 @@ public: "XSRETURN(argvi);\n", "fail:\n", cleanup, - ";\n", /* empty statement */ - "croak(Nullch);\n" + "croak(\"swig/perl error\");\n" + "XSRETURN(0);\n" "}\n", "}\n", NIL); @@ -838,6 +849,7 @@ public: NIL); if ((tm = Swig_typemap_lookup_new("varout",n,name,0))) { + SwigType *t = Getattr(n,"type"); Replaceall(tm,"$target","sv"); Replaceall(tm,"$result","sv"); Replaceall(tm,"$source",name); diff --git a/Source/Modules/tcl8.cxx b/Source/Modules/tcl8.cxx index aac0f3a8b..3cf983817 100644 --- a/Source/Modules/tcl8.cxx +++ b/Source/Modules/tcl8.cxx @@ -196,9 +196,8 @@ public: Swig_register_filebyname("itcl",f_shadow); Printv(f_shadow, - "# This file was created automatically by SWIG.\n", + "# This file was created automatically by SWIG ", PACKAGE_VERSION, ".\n", "# Don't modify this file, modify the SWIG interface instead.\n", - "# This file is compatible with both classic and new-style classes.\n", NIL); Printv(f_shadow,"\npackage require Itcl\n\n", NIL);