From: panne Date: Thu, 20 Apr 2000 16:28:39 +0000 (+0000) Subject: [project @ 2000-04-20 16:28:39 by panne] X-Git-Tag: Approximately_9120_patches~4635 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=c5b20ebe40851da1bdff06a60ff1416a78f6bce5;p=ghc-hetmet.git [project @ 2000-04-20 16:28:39 by panne] To avoid potential collisions between different modules, prefix the names of the C stubs with the module name. --- diff --git a/ghc/compiler/deSugar/DsForeign.lhs b/ghc/compiler/deSugar/DsForeign.lhs index 65d0607..7817c52 100644 --- a/ghc/compiler/deSugar/DsForeign.lhs +++ b/ghc/compiler/deSugar/DsForeign.lhs @@ -332,7 +332,7 @@ dsFExportDynamic i ty mod_name ext_name cconv = newSysLocalDs ty `thenDs` \ fe_id -> let -- hack: need to get at the name of the C stub we're about to generate. - fe_nm = toCName fe_id + fe_nm = moduleUserString mod_name ++ "_" ++ toCName fe_id fe_ext_name = ExtName (_PK_ fe_nm) Nothing in dsFExport i export_ty mod_name fe_ext_name cconv True @@ -434,7 +434,7 @@ fexportEntry mod_nm c_nm helper args res_ty cc isDyn = (header_bits, c_bits) -- create the application + perform it. , text "rc=rts_evalIO" <> parens (foldl appArg (text "(StgClosure*)&" <> h_nm) (zip args c_args) <> comma <> text "&ret") <> semi - , text "rts_checkSchedStatus" <> parens (doubleQuotes (text mod_nm <> char '.' <> ptext c_nm) + , text "rts_checkSchedStatus" <> parens (doubleQuotes (ptext c_nm) <> comma <> text "rc") <> semi , text "return" <> return_what <> semi , rbrace