From b79fd0139e6469e52f1fa10663a7558b2abced05 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 23 Mar 2001 17:04:26 +0000 Subject: [PATCH] [project @ 2001-03-23 17:04:26 by simonmar] don't forget to inject a #include for the stub.h file. --- ghc/compiler/main/CodeOutput.lhs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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} -- 1.7.10.4