Stdcall v. ccall on Windows FFI

Mauricio CA mauricio.antunes at
Wed Jun 22 02:28:47 CEST 2011


Haskell FFI addendum, when talking about calling conventions, says

       Calling convention of the standard C compiler on a system
       Calling convention of the Win32 API (matches Pascal conventions)

I wonder: what would correspond to such "standard C compiler" in
Windows? Is it, say, Visual Studio? And which convention does it use
by default?  Is it safe to assume that whatever is contained in a C file
compiled inside a Cabal package in Windows will have a calling convention
matched by 'ccall'?

(The reason I'm asking this is because I maintain a FFI macro package[2]
that is supposed to be portable between OSs, and I would like to be sure
I give a good solution to Windows portability.)



More information about the Libraries mailing list