Stdcall v. ccall on Windows FFI

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


Hi,

Haskell FFI addendum, when talking about calling conventions, says
that[1]:

   ccall
       Calling convention of the standard C compiler on a system
   stdcall
       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.)

Thanks,
Maurício

[1] http://www.cse.unsw.edu.au/~chak/haskell/ffi/ffi/ffise3.html#x6-110003.1
[2] http://hackage.haskell.org/package/bindings-DSL





More information about the Libraries mailing list