[Mono-dev] Marshalling: Bug in StructLayout?

Prakash Punnoor prakash at punnoor.de
Sat Aug 18 17:55:04 EDT 2007


Am Samstag 18 August 2007 schrieb Jonathan Pryor:
> On Sat, 2007-08-18 at 16:20 +0200, Prakash Punnoor wrote:
> > I am not sure whether I am making something wrong or mono has a bug.
> > Please see attached program. If declare the AVRational struct with
> > explicit offsets, it works, otherwise the width member (and following) in
> > AVFormatContext are off by 4 bytes.
>
> Out of curiosity, what happens if you remove all attributes, e.g.:
>
>                 public struct AVRational
>                 {
>                         public int num;
>                         public int den;
>                 }
>
> (The [StructLayout] shouldn't be necessary, as sequential layout is the
> default for structs, and the [MarshalAs] shouldn't be necessary, as, I4
> is the default for `int' as well.)

Nope, same issue.

-- 
(°=                 =°)
//\ Prakash Punnoor /\\
V_/                 \_V
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070818/a3e68a99/attachment.bin 


More information about the Mono-devel-list mailing list