summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Gustavsson <pjohangustavsson@hotmail.se>2016-02-04 19:34:19 +0100
committerWilliam S Fulton <wsf@fultondesigns.co.uk>2016-02-06 08:59:50 +0000
commit1458326f4c93de3f3413e4963ff047dc6823e9d8 (patch)
tree0f020952a5927c58cf368e094d89df1934266769
parent33c17b6d5ee325d0b537ed21f3ae949923e5af85 (diff)
downloadswig-1458326f4c93de3f3413e4963ff047dc6823e9d8.tar.gz
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.
-rw-r--r--Source/Modules/csharp.cxx10
1 files changed, 9 insertions, 1 deletions
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");