[Mono-list] PInvoke Conventions

Miguel de Icaza miguel@ximian.com
27 Jul 2001 15:52:00 -0400


> 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.