diff options
-rw-r--r-- | Examples/test-suite/csharp/director_void_runme.cs | 6 | ||||
-rw-r--r-- | Examples/test-suite/director_void.i | 4 | ||||
-rw-r--r-- | Lib/csharp/csharp.swg | 9 |
3 files changed, 19 insertions, 0 deletions
diff --git a/Examples/test-suite/csharp/director_void_runme.cs b/Examples/test-suite/csharp/director_void_runme.cs index 24b470f11..ef440a76a 100644 --- a/Examples/test-suite/csharp/director_void_runme.cs +++ b/Examples/test-suite/csharp/director_void_runme.cs @@ -67,6 +67,12 @@ public class runme if (x != 1334) throw new Exception("Bad4 should be 1334, got " + x); } + { + MemberVoid mv = new MemberVoid(); + global::System.IntPtr zero = global::System.IntPtr.Zero; + mv.memberVariable = zero; + zero = mv.memberVariable; + } } } diff --git a/Examples/test-suite/director_void.i b/Examples/test-suite/director_void.i index 40f53b6e2..d9d99aaac 100644 --- a/Examples/test-suite/director_void.i +++ b/Examples/test-suite/director_void.i @@ -43,5 +43,9 @@ struct Caller { return *(int *)p; } }; + +struct MemberVoid { + void *memberVariable; +}; %} diff --git a/Lib/csharp/csharp.swg b/Lib/csharp/csharp.swg index 832206386..ecc1983a7 100644 --- a/Lib/csharp/csharp.swg +++ b/Lib/csharp/csharp.swg @@ -875,6 +875,15 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { global::System.IntPtr ret = $imcall;$excode return ret; } +%typemap(csvarin, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ + set { + $imcall;$excode + } %} +%typemap(csvarout, excode=SWIGEXCODE2) void *VOID_INT_PTR %{ + get { + global::System.IntPtr ret = $imcall;$excode + return ret; + } %} %typemap(csdirectorin) void *VOID_INT_PTR "$iminput" %typemap(csdirectorout) void *VOID_INT_PTR "$cscall" |