[Mono-list] Mono/.NET delegate incompatibility

Fergus Henderson fjh@cs.mu.oz.au
Thu, 19 Dec 2002 14:18:35 +1100


On 18-Dec-2002, Miguel de Icaza <miguel@ximian.com> wrote:
> 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.

It's also a feature also of the Windows ABI.

Note that support for __stdcall has just recently been added to GCC
(the main CVS branch -- it should be included in GCC 3.4, I think).

-- 
Fergus Henderson <fjh@cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.