From 34a035e3f1e2ffc19c9fbb99e26a804254523908 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Fri, 1 Apr 2005 19:46:06 +0000 Subject: [PATCH] template ext mode on for all languages, not just Python now git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7130 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/CParse/parser.y | 8 ++------ SWIG/Source/Modules/lang.cxx | 12 +----------- SWIG/Source/Modules/main.cxx | 4 ---- SWIG/Source/Modules/python.cxx | 5 ----- SWIG/Source/Modules/swigmod.h | 1 - SWIG/Source/Swig/swig.h | 1 - 6 files changed, 3 insertions(+), 28 deletions(-) diff --git a/SWIG/Source/CParse/parser.y b/SWIG/Source/CParse/parser.y index 99ce7b7d9..b0309c746 100644 --- a/SWIG/Source/CParse/parser.y +++ b/SWIG/Source/CParse/parser.y @@ -2423,12 +2423,8 @@ template_directive: SWIGTEMPLATE LPAREN idstringopt RPAREN idcolonnt LESSTHAN va String *nname = NewStringf("__dummy_%d__", cnt++); Swig_cparse_template_expand(templnode,nname,temparms,tscope); Setattr(templnode,"sym:name",nname); - if (!Swig_template_extmode()) { - Setattr(templnode,"feature:ignore","1"); - } else { - Setattr(templnode,"feature:onlychildren", - "typemap,typemapitem,typemapcopy,typedef,types,fragment"); - } + Setattr(templnode,"feature:onlychildren", + "typemap,typemapitem,typemapcopy,typedef,types,fragment"); } Delattr(templnode,"templatetype"); Setattr(templnode,"template",nn); diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index 5a0859225..60f213e17 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -20,7 +20,6 @@ char cvsroot_lang_cxx[] = "$Header$"; static int director_mode = 0; /* set to 0 on default */ static int director_protected_mode = 0; /* set to 0 on default */ -static int template_extmode = 0; /* set to 0 on default */ /* Set director_protected_mode */ void Wrapper_director_mode_set(int flag) { @@ -31,10 +30,6 @@ void Wrapper_director_protected_mode_set(int flag) { director_protected_mode = flag; } -void Wrapper_template_extmode_set(int flag) { - template_extmode = flag; -} - extern "C" { int Swig_director_mode() { @@ -45,11 +40,6 @@ extern "C" { { return director_protected_mode; } - - int Swig_template_extmode() - { - return template_extmode; - } } @@ -2585,7 +2575,7 @@ Language::classLookup(SwigType *s) { Delete(base); Delete(prefix); } - if (n && (Getattr(n,"feature:ignore"))) { + if (n && (Getattr(n,"feature:ignore") || Getattr(n,"feature:onlychildren"))) { n = 0; } diff --git a/SWIG/Source/Modules/main.cxx b/SWIG/Source/Modules/main.cxx index 38979fe8c..ac846b3df 100644 --- a/SWIG/Source/Modules/main.cxx +++ b/SWIG/Source/Modules/main.cxx @@ -671,10 +671,6 @@ int SWIG_main(int argc, char *argv[], Language *l) { Wrapper_director_mode_set(0); Wrapper_director_protected_mode_set(0); - /* Turn off template extmode */ - Wrapper_template_extmode_set(0); - - // Check for SWIG_LIB environment variable if ((c = getenv("SWIG_LIB")) == (char *) 0) { diff --git a/SWIG/Source/Modules/python.cxx b/SWIG/Source/Modules/python.cxx index e40bfdd0b..8a10e16a6 100644 --- a/SWIG/Source/Modules/python.cxx +++ b/SWIG/Source/Modules/python.cxx @@ -107,11 +107,6 @@ public: SWIG_library_directory("python"); - - - /* Turn on template extmode */ - Wrapper_template_extmode_set(1); - for (int i = 1; i < argc; i++) { if (argv[i]) { if(strcmp(argv[i],"-interface") == 0) { diff --git a/SWIG/Source/Modules/swigmod.h b/SWIG/Source/Modules/swigmod.h index 9a8e4a9c9..bea35544e 100644 --- a/SWIG/Source/Modules/swigmod.h +++ b/SWIG/Source/Modules/swigmod.h @@ -350,7 +350,6 @@ int is_member_director(Node* member); void Wrapper_virtual_elimination_mode_set(int); void Wrapper_director_mode_set(int); void Wrapper_director_protected_mode_set(int); -void Wrapper_template_extmode_set(int); void clean_overloaded(Node *n); diff --git a/SWIG/Source/Swig/swig.h b/SWIG/Source/Swig/swig.h index a97e5536b..75e7fd809 100644 --- a/SWIG/Source/Swig/swig.h +++ b/SWIG/Source/Swig/swig.h @@ -532,7 +532,6 @@ extern void Swig_fragment_emit(String *name); /* hacks defined in C++ ! */ extern int Swig_need_protected(); extern int Swig_director_mode(); -extern int Swig_template_extmode(); #ifdef __cplusplus }