[Mono-list] Mono/.NET delegate incompatibility

Miguel de Icaza miguel@ximian.com
18 Dec 2002 19:41:30 -0500


Hello,

> I am using a delegate to pass a function pointer into a unmanaged DLL.
> Under Linux/Mono everything works fine. Under Windows/.NET, my callback
> function signature must look like this:
> 
>   void (__stdcall *func)(int);
> 
> But Windows/Mono seems to want:
> 
>   void (*func)(int);

__stdcall is a Microsoft-C feature, so it is really a feature of your
compiler.  There are some macros around that you can use to make your C
code portable (not really Mono's domain), like STDCALL that get defined
to nothing on Unix.

Miguel