From bf0ae5ee50ef23af9e2c46acf3d3e652b2afe118 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Mon, 28 Mar 2005 19:43:55 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@7101 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/CHANGES.current | 4 ++++ SWIG/Source/Swig/typesys.c | 49 ++++++++++++++++++++------------------ 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/SWIG/CHANGES.current b/SWIG/CHANGES.current index 9cb79289a..3cbe7658b 100644 --- a/SWIG/CHANGES.current +++ b/SWIG/CHANGES.current @@ -1,6 +1,10 @@ Version 1.3.25 (In progress) ============================ +03/22/2005: wsfulton + Enum casting fixes. Visual C++ didn't like the C type casting SWIG produced + when wrapping C++ enum references, as reported by Admire Kandawasvika. + 03/21/2005: wsfulton [Perl] SF #1124490. Fix Perl macro clashes when using Visual Studio's STL string, so now projects can #include . diff --git a/SWIG/Source/Swig/typesys.c b/SWIG/Source/Swig/typesys.c index 5acd9ea58..72b0e5d1a 100644 --- a/SWIG/Source/Swig/typesys.c +++ b/SWIG/Source/Swig/typesys.c @@ -507,39 +507,42 @@ static Typetab *resolved_scope = 0; static SwigType * typedef_resolve(Typetab *s, String *base) { Hash *ttab; - SwigType *type; + SwigType *type = 0; List *inherit; Typetab *parent; /* if (!s) return 0; *//* now is checked bellow */ /* Printf(stdout,"Typetab %s : %s\n", Getattr(s,"name"), base); */ - if (Getmark(s)) return 0; - Setmark(s,1); + if (!Getmark(s)) { + Setmark(s,1); - ttab = Getattr(s,k_typetab); - type = Getattr(ttab,base); - if (type) { - resolved_scope = s; - Setmark(s,0); - return type; - } - /* Hmmm. Not found in my scope. It could be in an inherited scope */ - inherit = Getattr(s,k_inherit); - if (inherit) { - int i,len; - len = Len(inherit); - for (i = 0; i < len; i++) { - type = typedef_resolve(Getitem(inherit,i), base); - if (type) { - Setmark(s,0); - return type; + ttab = Getattr(s,k_typetab); + type = Getattr(ttab,base); + if (type) { + resolved_scope = s; + Setmark(s,0); + } else { + /* Hmmm. Not found in my scope. It could be in an inherited scope */ + inherit = Getattr(s,k_inherit); + if (inherit) { + int i,len; + len = Len(inherit); + for (i = 0; i < len; i++) { + type = typedef_resolve(Getitem(inherit,i), base); + if (type) { + Setmark(s,0); + break; + } + } + } + if (!type) { + parent = Getattr(s,k_parent); + type = parent ? typedef_resolve(parent, base) : 0; + Setmark(s,0); } } } - parent = Getattr(s,k_parent); - type = parent ? typedef_resolve(parent, base) : 0; - Setmark(s,0); return type; }