[MLton] Windows port of MLton using the Microsoft tools (e.g. without MinGW)

skaller skaller at users.sourceforge.net
Thu Jul 26 11:49:07 PDT 2007


On Thu, 2007-07-26 at 12:29 -0500, Matthew Fluet wrote:

> Similarly, unless you have otherwise patched 
> mlton/elaborate/elaborate-core.fun, MLton assumes that all FFI functions 
> are called via the 'cdecl' calling convention (unless they are 
> specifically annoted by 'stdcall' and the target platform is Cygwin or 
> MinGW).  However, since all the runtime functions are built using the 
> MS toolchain, they may be assuming a 'stdcall' convention.  The native 
> codegen knows how to implement the stdcall calling convention, but the FFI 
> functions may simply be defaulting to cdecl.

Ouch .. hmm. Some links:

http://blogs.msdn.com/oldnewthing/archive/2006/07/27/679634.aspx

http://msdn2.microsoft.com/en-us/library/zthk2dkh(VS.80).aspx

In particular note: there is only ONE calling convention for x64,
namely 'fastcall': neither cdecl nor stdcall are meaningful and
are ignored:

http://msdn2.microsoft.com/en-us/library/ms235286(VS.80).aspx

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net



More information about the MLton mailing list