From 32a59010e496a48b42d3d37310d522bd01720ad8 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 12 Oct 2006 19:47:24 +0000 Subject: [PATCH] fix parentnode for %extend methods git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9442 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- SWIG/Source/Modules/lang.cxx | 2 +- SWIG/Source/Modules/utils.cxx | 2 +- SWIG/Source/Swig/cwrap.c | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SWIG/Source/Modules/lang.cxx b/SWIG/Source/Modules/lang.cxx index de875a283..3a6316314 100644 --- a/SWIG/Source/Modules/lang.cxx +++ b/SWIG/Source/Modules/lang.cxx @@ -975,7 +975,7 @@ Language::functionHandler(Node *n) { globalfunctionHandler(n); } else { Node* explicit_n = 0; - if (directorsEnabled() && is_member_director(CurrentClass,n) && !Extend && !extraDirectorProtectedCPPMethodsRequired()) { + if (directorsEnabled() && is_member_director(CurrentClass,n) && !extraDirectorProtectedCPPMethodsRequired()) { bool virtual_but_not_pure_virtual = (!(Cmp(storage, "virtual")) && (Cmp(Getattr(n, "value"), "0") != 0)); if (virtual_but_not_pure_virtual) { // Add additional wrapper which makes an explicit call to the virtual method (ie not a virtual call) diff --git a/SWIG/Source/Modules/utils.cxx b/SWIG/Source/Modules/utils.cxx index b22b9acdd..cfa64b24e 100644 --- a/SWIG/Source/Modules/utils.cxx +++ b/SWIG/Source/Modules/utils.cxx @@ -39,7 +39,7 @@ int is_member_director(Node* parentnode, Node* member) int parent_director = director_mode && GetFlag(parentnode,"feature:director"); int cdecl_director = parent_director || GetFlag(member,"feature:director"); int cdecl_nodirector = GetFlag(member,"feature:nodirector"); - return cdecl_director && !cdecl_nodirector; + return cdecl_director && !cdecl_nodirector && !GetFlag(member, "feature:extend"); } else { return 0; } diff --git a/SWIG/Source/Swig/cwrap.c b/SWIG/Source/Swig/cwrap.c index 8abdb2573..d9a043261 100644 --- a/SWIG/Source/Swig/cwrap.c +++ b/SWIG/Source/Swig/cwrap.c @@ -986,9 +986,9 @@ Swig_MethodToFunction(Node *n, String *classname, int flags, SwigType *director_ Node* Swig_methodclass(Node *n) { - Node* type = Getattr(n, k_nodetype); - if (!Cmp(type, "class")) return n; - return Getattr(n, k_parentnode); + Node* nodetype = Getattr(n, k_nodetype); + if (!Cmp(nodetype, "class")) return n; + return GetFlag(n, "feature:extend") ? Getattr(Getattr(n, k_parentnode), k_parentnode) : Getattr(n, k_parentnode); } int