From 004643ff30118e7a61484f329bfeebebfb202053 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Thu, 25 Nov 2010 20:39:11 +0000 Subject: [PATCH] Fix mangling of PHP constructor wrapper when types use global scope or typedefs git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12309 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/php.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Modules/php.cxx b/Source/Modules/php.cxx index 05f2082c2..b95eaa7cd 100644 --- a/Source/Modules/php.cxx +++ b/Source/Modules/php.cxx @@ -1601,10 +1601,9 @@ public: Delete(args); args = NewString("$res=null"); } - SwigType *t = Getattr(current_class, "classtype"); - String *mangled_type = SwigType_manglestr(SwigType_ltype(t)); + String *mangled_type = SwigType_manglestr(Getattr(n, "type")); Printf(output, "\t%sfunction %s(%s) {\n", acc, methodname, args); - Printf(output, "\t\tif (is_resource($%s) && get_resource_type($%s) === '_p%s') {\n", arg0, arg0, mangled_type); + Printf(output, "\t\tif (is_resource($%s) && get_resource_type($%s) === '%s') {\n", arg0, arg0, mangled_type); Printf(output, "\t\t\t$this->%s=$%s;\n", SWIG_PTR, arg0); Printf(output, "\t\t\treturn;\n"); Printf(output, "\t\t}\n");