Commit e0546be2 authored by simonmar's avatar simonmar
Browse files

[project @ 2004-10-18 11:38:41 by simonmar]

Make foreign import stdcall "dynamic" work via-C (we'd forgotten to
add the __stdcall qualifier to the type cast for the function).
parent edef9ad6
......@@ -195,7 +195,7 @@ pprStmt stmt = case stmt of
where
ppr_fn = case fn of
CmmLit (CmmLabel lbl) -> pprCLabel lbl
_other -> parens (cCast (pprCFunType results args) fn)
_other -> parens (cCast (pprCFunType cconv results args) fn)
-- for a dynamic call, cast the expression to
-- a function of the right type (we hope).
......@@ -218,9 +218,13 @@ pprStmt stmt = case stmt of
CmmJump lbl _params -> mkJMP_(pprExpr lbl) <> semi
CmmSwitch arg ids -> pprSwitch arg ids
pprCFunType :: [(CmmReg,MachHint)] -> [(CmmExpr,MachHint)] -> SDoc
pprCFunType ress args =
res_type ress <> parens (char '*') <> parens (commafy (map arg_type args))
pprCFunType :: CCallConv -> [(CmmReg,MachHint)] -> [(CmmExpr,MachHint)] -> SDoc
pprCFunType cconv ress args
= hcat [
res_type ress,
parens (text (ccallConvAttribute cconv) <> char '*'),
parens (commafy (map arg_type args))
]
where
res_type [] = ptext SLIT("void")
res_type [(one,hint)] = machRepHintCType (cmmRegRep one) hint
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment