X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=ghc%2Fcompiler%2Fprelude%2FForeignCall.lhs;h=bceb0241f27b40c0feb6b79b15045523f88bda30;hb=1dfaee318171836b32f6b33a14231c69adfdef2f;hp=47eafed478c55072444c5b2dd9c7674851460768;hpb=cbdeae8fc8a1c72d20d89241acae8a313214b51c;p=ghc-hetmet.git diff --git a/ghc/compiler/prelude/ForeignCall.lhs b/ghc/compiler/prelude/ForeignCall.lhs index 47eafed..bceb024 100644 --- a/ghc/compiler/prelude/ForeignCall.lhs +++ b/ghc/compiler/prelude/ForeignCall.lhs @@ -104,7 +104,17 @@ isCasmTarget other = False \end{code} -Stuff to do with calling convention +Stuff to do with calling convention: + +ccall: Caller allocates parameters, *and* deallocates them. + +stdcall: Caller allocates parameters, callee deallocates. + Function name has @N after it, where N is number of arg bytes + e.g. _Foo@8 + +ToDo: The stdcall calling convention is x86 (win32) specific, +so perhaps we should emit a warning if it's being used on other +platforms. \begin{code} data CCallConv = CCallConv | StdCallConv @@ -125,10 +135,6 @@ ccallConvToInt CCallConv = 1 Generate the gcc attribute corresponding to the given calling convention (used by PprAbsC): -ToDo: The stdcall calling convention is x86 (win32) specific, -so perhaps we should emit a warning if it's being used on other -platforms. - \begin{code} ccallConvAttribute :: CCallConv -> String ccallConvAttribute StdCallConv = "__stdcall"