[Mono-list] PInvoke Conventions

Bob Smith bob@thestuff.net
27 Jul 2001 15:00:29 -0600


can offsetof be used at runtime? if so, we might be able to use metadata
and offsetof & sizeof to do all of the struct stuff on the fly.

On 27 Jul 2001 15:52:00 -0400, Miguel de Icaza wrote:
> 
> > One way to do this would be to write C programs that generate the C# files.
> > The C programs can include all the appropriate header files,
> > 
> > 	  #include <foo.h>
> > 
> > and can then output the values of the constants directly:
> > 
> > 	  printf("const int FOO = %d\n", FOO);
> > 
> > For structs and other types, the C program can use sizeof() and offsetof()
> > to ascertain the representation and/or layout, and can then output C# code
> > accordingly.
> 
> This sounds exactly what we want to do.
> 
> > If this becomes cumbersome, and you want to get fancy, you can write a program
> > to generate the C programs that generate the C# files ;-)
> 
> HAHAHA.
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>