[Mono-devel-list] Unions in C#, and the Bug# 58798 in GDA

Daniel Espinosa esodan at gmail.com
Fri Apr 15 12:09:04 EDT 2005

I found that Gtk# use a series of perl script as well as C# program
called CodeGenerator, to auto-generate C# code from the sources.

In the case of Gda#, theres a definition of a fundamental type called
GdaValue, wich in his definition has a union (like in GValue struct),
but the parser and CodeGenerator, don't have support to generate a C#
representative of a union.

You know, in C# doesn't exist unions, but you can use the FieldOffset
attribute at cero, to have a in memory representation of a union. The
actual definition of GdaValue and "correct" code representation in C#
can be found the report and comments of the bug# 58798.

The the parser (a perl script called gapi-parser and the sub scripts,
specialy the api2xml) need generate a correcto XML file representation
for a union, and need be modified the C# code for CodeGenerator to
work around.

I'll try to help in any form, but I'm not a expert in perl or C#; but
I think it's very important to have Gda# working in Mono.

More information about the Mono-devel-list mailing list