From: simonmar Date: Fri, 23 Mar 2001 17:04:26 +0000 (+0000) Subject: [project @ 2001-03-23 17:04:26 by simonmar] X-Git-Tag: Approximately_9120_patches~2326 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=b79fd0139e6469e52f1fa10663a7558b2abced05;p=ghc-hetmet.git [project @ 2001-03-23 17:04:26 by simonmar] don't forget to inject a #include for the stub.h file. --- diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 3ff665e..5c61a5d 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -71,7 +71,7 @@ codeOutput dflags mod_name tycons core_binds stg_binds HscInterpreted -> return stub_names HscAsm -> outputAsm dflags filenm flat_abstractC >> return stub_names - HscC -> outputC dflags filenm flat_abstractC + HscC -> outputC dflags filenm flat_abstractC stub_names >> return stub_names HscJava -> outputJava dflags filenm mod_name tycons core_binds >> return stub_names @@ -98,11 +98,14 @@ doOutput filenm io_action %************************************************************************ \begin{code} -outputC dflags filenm flat_absC +outputC dflags filenm flat_absC (maybe_stub_h, _) = do dumpIfSet_dyn dflags Opt_D_dump_realC "Real C" (dumpRealC flat_absC) header <- readIORef v_HCHeader doOutput filenm $ \ h -> do hPutStr h header + case maybe_stub_h of + Nothing -> return () + Just filename -> hPutStrLn h ("#include \"" ++ filename ++ "\"") writeRealC h flat_absC \end{code}