Commit 92a2a3c2 authored by panne's avatar panne
Browse files

[project @ 2000-06-12 18:13:20 by panne]

`foreign label foo :: Addr' was simply mapped to `foo' on the C side,
but this is wrong, resp. only works for C *functions*, not *variables*
(praise the implicit conversions of C!). It now correctly maps to `(&foo)'.

ATTENTION: I'm not sure if this fix breaks some SW which depends on
the old (wrong) behaviour (H/Direct?).
parent 422fcdca
...@@ -171,8 +171,9 @@ Foreign labels ...@@ -171,8 +171,9 @@ Foreign labels
dsFLabel :: Id -> ExtName -> DsM CoreBind dsFLabel :: Id -> ExtName -> DsM CoreBind
dsFLabel nm ext_name = returnDs (NonRec nm fo_rhs) dsFLabel nm ext_name = returnDs (NonRec nm fo_rhs)
where where
fo_rhs = mkConApp addrDataCon [mkLit (MachLitLit enm addrPrimTy)] fo_rhs = mkConApp addrDataCon [mkLit (MachLitLit addr addrPrimTy)]
enm = extNameStatic ext_name enm = extNameStatic ext_name
addr = SLIT("(&") _APPEND_ enm _APPEND_ SLIT(")")
\end{code} \end{code}
The function that does most of the work for `@foreign export@' declarations. The function that does most of the work for `@foreign export@' declarations.
......
Supports Markdown
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