[Mono-list] pinvoke4
Ferguson, Neale
Neale.Ferguson@SoftwareAG-USA.com
Tue, 1 Oct 2002 22:20:08 -0400
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C269BA.3A2A7610
Content-Type: text/plain;
charset="iso-8859-1"
In pinvoke4.cs simplestruct is defined as:
public struct SimpleStruct {
public bool a;
public bool b;
public bool c;
public string d;
}
In libtest.c simplestruct is defined as:
typedef struct {
int a;
int b;
int c;
char *d;
} simplestruct
However, when mono_create_trampoline the size of the returned by:
mono_class_value_size (sig->ret->data.klass, NULL) is 8. Why is it not 16? I
guess the answer is it should be 16 but I'm doing something stupid.
Neale Ferguson
------_=_NextPart_001_01C269BA.3A2A7610
Content-Type: text/html;
charset="iso-8859-1"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2713.1100" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=552231503-02102002><FONT face=Arial size=2>In <FONT
face="Courier New" color=#800000>pinvoke4.cs</FONT> simplestruct is defined
as:</FONT></SPAN></DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial size=2><FONT
face="Courier New" color=#0000ff>
public struct SimpleStruct
{<BR>
public bool
a;<BR>
public bool
b;<BR>
public bool
c;<BR>
public string d;<BR>
}</FONT><BR></FONT></SPAN></DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial size=2>In <FONT
face="Courier New" color=#800000>libtest.c</FONT> simplestruct is defined
as:</FONT></SPAN></DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=552231503-02102002><FONT face="Courier New" color=#0000ff
size=2>typedef struct {<BR> int
a;<BR> int
b;<BR> int
c;<BR> char *d;<BR>}
simplestruct</FONT></SPAN></DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=552231503-02102002><FONT face=Arial size=2>However, when <FONT
face="Courier New" color=#0000ff>mono_create_trampoline</FONT> the size of the
returned by: <FONT face="Courier New" color=#0000ff>mono_class_value_size
(sig->ret->data.klass, NULL)</FONT> is 8. Why is it not 16? I guess the
answer is it should be 16 but I'm doing something stupid.</FONT></SPAN></DIV>
<P><FONT face="Monotype Corsiva">Neale Ferguson</FONT> <BR></P></BODY></HTML>
------_=_NextPart_001_01C269BA.3A2A7610--