Add C# support for void *VOID_INT_PTR member variables
Issue reported by Carlos Frederico Biscaya on swig-user mailing list.
This commit is contained in:
parent
a38f30a194
commit
bfddc50a6a
3 changed files with 19 additions and 0 deletions
|
|
@ -67,6 +67,12 @@ public class runme
|
||||||
if (x != 1334)
|
if (x != 1334)
|
||||||
throw new Exception("Bad4 should be 1334, got " + x);
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,5 +43,9 @@ struct Caller {
|
||||||
return *(int *)p;
|
return *(int *)p;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct MemberVoid {
|
||||||
|
void *memberVariable;
|
||||||
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -875,6 +875,15 @@ SWIGINTERN const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
|
||||||
global::System.IntPtr ret = $imcall;$excode
|
global::System.IntPtr ret = $imcall;$excode
|
||||||
return ret;
|
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(csdirectorin) void *VOID_INT_PTR "$iminput"
|
||||||
%typemap(csdirectorout) void *VOID_INT_PTR "$cscall"
|
%typemap(csdirectorout) void *VOID_INT_PTR "$cscall"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue