From bbac8ca521ccf023fe57e61dd882168a97d6e83f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Aug 2019 14:40:09 +0200 Subject: [PATCH] Don't reimplement base class version of globalfunctionHandler() This is useless and the C-specific version didn't handle template methods added with %extend correctly, so removing this code also fixes some (but not all yet) failures in extend_template_method.cpptest unit test. --- Source/Modules/c.cxx | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/Source/Modules/c.cxx b/Source/Modules/c.cxx index 8c53f8f76..6d72cac32 100644 --- a/Source/Modules/c.cxx +++ b/Source/Modules/c.cxx @@ -531,25 +531,13 @@ public: virtual int globalfunctionHandler(Node *n) { SwigType *type = Getattr(n, "type"); - ParmList *parms = Getattr(n, "parms"); - String *arg_list = NewString(""); - String *call = empty_string; - String *cres = empty_string; - call = Swig_cfunction_call(Getattr(n, "name"), parms); - cres = Swig_cresult(type, "result", call); - Setattr(n, "wrap:action", cres); Setattr(n, "c:globalfun", "1"); if (!SwigType_ispointer(type) && !SwigType_isreference(type)) Setattr(n, "c:retval", "1"); - functionWrapper(n); - - Delete(cres); - Delete(call); - Delete(arg_list); - return SWIG_OK; + return Language::globalfunctionHandler(n); } /* ----------------------------------------------------------------------