From 1458326f4c93de3f3413e4963ff047dc6823e9d8 Mon Sep 17 00:00:00 2001 From: Johan Gustavsson Date: Thu, 4 Feb 2016 19:34:19 +0100 Subject: Update csharp.cxx When people use the -namespace option, they often intend for the input to swig to wrap a particular namespace in a single module. This option should also have an effect on how C++ wrapper function names are mangled, and not just the C# proxy code. --- Source/Modules/csharp.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/Modules/csharp.cxx b/Source/Modules/csharp.cxx index eaa027f2a..8a047c46d 100644 --- a/Source/Modules/csharp.cxx +++ b/Source/Modules/csharp.cxx @@ -415,8 +415,16 @@ public: } Printf(f_runtime, "\n"); + if (namespce) { + String *wrapper_name = NewStringf(""); + Printf(wrapper_name, "CSharp_%s_%%f", namespce); + Swig_name_register("wrapper", wrapper_name); + Delete(wrapper_name); + } + else { + Swig_name_register("wrapper", "CSharp_%f"); + } - Swig_name_register("wrapper", "CSharp_%f"); if (old_variable_names) { Swig_name_register("set", "set_%n%v"); Swig_name_register("get", "get_%n%v"); -- cgit v1.2.1