From 433a1743ab9d3bf4f6b59081e7bc60bcb262116c Mon Sep 17 00:00:00 2001 From: Leif Middelschulte Date: Wed, 18 Jul 2012 23:35:22 +0000 Subject: [PATCH] Namespace functions as well; Remove :: from tl elements git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-c@13332 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/c.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Source/Modules/c.cxx b/Source/Modules/c.cxx index e7340c357..0fe69e250 100644 --- a/Source/Modules/c.cxx +++ b/Source/Modules/c.cxx @@ -111,6 +111,7 @@ public: goto _get_proxyname_return; if (nspace) { + Replaceall(nspace, ".", "_"); // Classes' namespaces get dotted -> replace; FIXME in core! proxyname = Swig_name_proxy(nspace, symname); if (tl_namespace) proxyname = Swig_name_proxy(tl_namespace, proxyname); @@ -402,7 +403,10 @@ public: String *arg_list = NewString(""); String *call = empty_string; String *cres = empty_string; - + String *nspaced_symname = Swig_name_mangle(Getattr(n, "name")); + + Setattr(n, "sym:name", nspaced_symname); + call = Swig_cfunction_call(Getattr(n, "name"), parms); cres = Swig_cresult(type, "result", call); Setattr(n, "wrap:action", cres); @@ -768,8 +772,10 @@ ready: } else { Printv(proxy_parm_type, c_parm_type, NIL); - //FIXME: implement "convert_to_c_namespace"? - Replaceall(proxy_parm_type, "::", "_"); + // Add namespace + Replaceall(proxy_parm_type, "::", "_"); // FIXME: implement "convert_to_c_namespace"? + if (strncmp(Char(proxy_parm_type), "_", 1) == 0) // Remove top level namespacing if necessary + Replace(proxy_parm_type, "_", "", DOH_REPLACE_FIRST); } Printv(proto, gencomma ? ", " : "", proxy_parm_type, " ", arg_name, NIL);