better option name templatereduce

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6542 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2004-10-28 19:31:33 +00:00
commit fc2f54c647
3 changed files with 11 additions and 10 deletions

View file

@ -1,5 +1,5 @@
#ifdef SWIGPYTHON #ifdef SWIGPYTHON
%module("tpltreduc") template_typedef %module("templatereduce") template_typedef
#else #else
%module template_typedef %module template_typedef
#endif #endif

View file

@ -1,11 +1,12 @@
%module("tpltreduc") template_typedef_ptr %module("templatereduce") template_typedef_ptr
%module("templatereduce") template_typedef_ptr
/* /*
Use the "tpltreduc" to force swig to reduce the temaplate Use the "templatereduce" option to force swig to reduce the
typedef as much as possible. temaplate typedef as much as possible.
This fix cases like this one, but it can prevent some This fix cases like the one in this file, but it can prevent some
typemaps for working. typemaps for working as expected.
*/ */

View file

@ -53,7 +53,7 @@ static Parm *template_parameters = 0;
static int extendmode = 0; static int extendmode = 0;
static int dirprot_mode = 0; static int dirprot_mode = 0;
static int compact_default_args = 0; static int compact_default_args = 0;
static int template_typedef_reduction = 0; static int template_reduce = 0;
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* Assist Functions * Assist Functions
@ -1625,8 +1625,8 @@ module_directive: MODULE options idstring {
*/ */
dirprot_mode = 1; dirprot_mode = 1;
} }
if (Getattr($2,"tpltreduc")) { if (Getattr($2,"templatereduce")) {
template_typedef_reduction = 1; template_reduce = 1;
} }
} }
if (!ModuleName) ModuleName = NewString($3); if (!ModuleName) ModuleName = NewString($3);
@ -2134,7 +2134,7 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va
if (!value) { if (!value) {
SwigType *ty = Getattr(p,"type"); SwigType *ty = Getattr(p,"type");
if (ty) { if (ty) {
if (template_typedef_reduction) { if (template_reduce) {
SwigType *rty = Swig_symbol_typedef_reduce(ty,0); SwigType *rty = Swig_symbol_typedef_reduce(ty,0);
ty = Swig_symbol_type_qualify(rty,0); ty = Swig_symbol_type_qualify(rty,0);
Setattr(p,"type",ty); Setattr(p,"type",ty);