Fix member pointer typemaps (32bit fix only though)
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9890 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fb51964d01
commit
6e4d5b4b3a
1 changed files with 40 additions and 8 deletions
|
|
@ -85,8 +85,8 @@
|
||||||
%typemap(cstype) SWIGTYPE & "$csclassname"
|
%typemap(cstype) SWIGTYPE & "$csclassname"
|
||||||
|
|
||||||
/* pointer to a class member */
|
/* pointer to a class member */
|
||||||
%typemap(ctype) SWIGTYPE (CLASS::*) "void *"
|
%typemap(ctype) SWIGTYPE (CLASS::*) "int64_t"
|
||||||
%typemap(imtype, out="IntPtr") SWIGTYPE (CLASS::*) "HandleRef"
|
%typemap(imtype) SWIGTYPE (CLASS::*) "ulong"
|
||||||
%typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname"
|
%typemap(cstype) SWIGTYPE (CLASS::*) "$csclassname"
|
||||||
|
|
||||||
/* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */
|
/* The following are the in and out typemaps. These are the PInvoke code generating typemaps for converting from C# to C and visa versa. */
|
||||||
|
|
@ -340,13 +340,16 @@
|
||||||
%typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle"
|
%typemap(csdirectorout) SWIGTYPE "$&csclassname.getCPtr($cscall).Handle"
|
||||||
|
|
||||||
/* Generic pointers and references */
|
/* Generic pointers and references */
|
||||||
%typemap(in) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ $1 = ($1_ltype)$input; %}
|
%typemap(in) SWIGTYPE * %{ $1 = ($1_ltype)$input; %}
|
||||||
|
%typemap(in) SWIGTYPE (CLASS::*) %{ $1 = *($&1_ltype)&$input; %}
|
||||||
%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input;
|
%typemap(in, canthrow=1) SWIGTYPE & %{ $1 = ($1_ltype)$input;
|
||||||
if(!$1) {
|
if(!$1) {
|
||||||
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type type is null", 0);
|
SWIG_CSharpSetPendingExceptionArgument(SWIG_CSharpArgumentNullException, "$1_type type is null", 0);
|
||||||
return $null;
|
return $null;
|
||||||
} %}
|
} %}
|
||||||
%typemap(out) SWIGTYPE *, SWIGTYPE (CLASS::*) %{ $result = (void *)$1; %}
|
%typemap(out) SWIGTYPE * %{ $result = (void *)$1; %}
|
||||||
|
%typemap(out) SWIGTYPE (CLASS::*) %{ *($&1_ltype)&$result = $1; %}
|
||||||
|
|
||||||
%typemap(out) SWIGTYPE & %{ $result = (void *)$1; %}
|
%typemap(out) SWIGTYPE & %{ $result = (void *)$1; %}
|
||||||
|
|
||||||
%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *, SWIGTYPE (CLASS::*)
|
%typemap(directorout, warning=SWIGWARN_TYPEMAP_DIRECTOROUT_PTR_MSG) SWIGTYPE *, SWIGTYPE (CLASS::*)
|
||||||
|
|
@ -506,7 +509,8 @@
|
||||||
"$csinput"
|
"$csinput"
|
||||||
%typemap(csin) char *, char[ANY], char[] "$csinput"
|
%typemap(csin) char *, char[ANY], char[] "$csinput"
|
||||||
%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)"
|
%typemap(csin) SWIGTYPE "$&csclassname.getCPtr($csinput)"
|
||||||
%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) "$csclassname.getCPtr($csinput)"
|
%typemap(csin) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "$csclassname.getCPtr($csinput)"
|
||||||
|
%typemap(csin) SWIGTYPE (CLASS::*) "$csclassname.getCMemberPtr($csinput)"
|
||||||
|
|
||||||
/* The csout typemap is used for converting function return types from the return type
|
/* The csout typemap is used for converting function return types from the return type
|
||||||
* used in the PInvoke class to the type returned by the proxy, module or type wrapper class.
|
* used in the PInvoke class to the type returned by the proxy, module or type wrapper class.
|
||||||
|
|
@ -588,11 +592,16 @@
|
||||||
$csclassname ret = new $csclassname($imcall, $owner);$excode
|
$csclassname ret = new $csclassname($imcall, $owner);$excode
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) {
|
%typemap(csout, excode=SWIGEXCODE) SWIGTYPE *, SWIGTYPE [] {
|
||||||
IntPtr cPtr = $imcall;
|
IntPtr cPtr = $imcall;
|
||||||
$csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode
|
$csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
%typemap(csout, excode=SWIGEXCODE) SWIGTYPE (CLASS::*) {
|
||||||
|
ulong cMemberPtr = $imcall;
|
||||||
|
$csclassname ret = (cMemberPtr == 0) ? null : new $csclassname(cMemberPtr, $owner);$excode
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Properties */
|
/* Properties */
|
||||||
|
|
@ -697,13 +706,20 @@
|
||||||
$csclassname ret = new $csclassname($imcall, $owner);$excode
|
$csclassname ret = new $csclassname($imcall, $owner);$excode
|
||||||
return ret;
|
return ret;
|
||||||
} %}
|
} %}
|
||||||
%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE *, SWIGTYPE [] %{
|
||||||
get {
|
get {
|
||||||
IntPtr cPtr = $imcall;
|
IntPtr cPtr = $imcall;
|
||||||
$csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode
|
$csclassname ret = (cPtr == IntPtr.Zero) ? null : new $csclassname(cPtr, $owner);$excode
|
||||||
return ret;
|
return ret;
|
||||||
} %}
|
} %}
|
||||||
|
|
||||||
|
%typemap(csvarout, excode=SWIGEXCODE2) SWIGTYPE (CLASS::*) %{
|
||||||
|
get {
|
||||||
|
ulong cMemberPtr = $imcall;
|
||||||
|
$csclassname ret = (cMemberPtr == 0) ? null : new $csclassname(cMemberPtr, $owner);$excode
|
||||||
|
return ret;
|
||||||
|
} %}
|
||||||
|
|
||||||
/* Pointer reference typemaps */
|
/* Pointer reference typemaps */
|
||||||
%typemap(ctype) SWIGTYPE *& "void *"
|
%typemap(ctype) SWIGTYPE *& "void *"
|
||||||
%typemap(imtype, out="IntPtr") SWIGTYPE *& "HandleRef"
|
%typemap(imtype, out="IntPtr") SWIGTYPE *& "HandleRef"
|
||||||
|
|
@ -761,7 +777,7 @@
|
||||||
%}
|
%}
|
||||||
|
|
||||||
// Typewrapper classes
|
// Typewrapper classes
|
||||||
%typemap(csbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], SWIGTYPE (CLASS::*) %{
|
%typemap(csbody) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{
|
||||||
private HandleRef swigCPtr;
|
private HandleRef swigCPtr;
|
||||||
|
|
||||||
internal $csclassname(IntPtr cPtr, bool futureUse) {
|
internal $csclassname(IntPtr cPtr, bool futureUse) {
|
||||||
|
|
@ -777,6 +793,22 @@
|
||||||
}
|
}
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%typemap(csbody) SWIGTYPE (CLASS::*) %{
|
||||||
|
private ulong swigCMemberPtr;
|
||||||
|
|
||||||
|
internal $csclassname(ulong cMemberPtr, bool futureUse) {
|
||||||
|
swigCMemberPtr = cMemberPtr;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected $csclassname() {
|
||||||
|
swigCMemberPtr = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static ulong getCMemberPtr($csclassname obj) {
|
||||||
|
return obj.swigCMemberPtr;
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%typemap(csfinalize) SWIGTYPE %{
|
%typemap(csfinalize) SWIGTYPE %{
|
||||||
~$csclassname() {
|
~$csclassname() {
|
||||||
Dispose();
|
Dispose();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue