- maybe_stub_c_file
- <- outputForeignStubs_help False{-not .h-} stub_c_output_w
-
- return (maybe_stub_h_file, maybe_stub_c_file)
+ -- Extend the list of foreign headers (used in outputC)
+ fhdrs <- readIORef v_HCHeader
+ let new_fhdrs = fhdrs ++ mkForeignHeaders hdrs
+ writeIORef v_HCHeader new_fhdrs
+
+ stub_c_file_exists
+ <- outputForeignStubs_help (hscStubCOutName dflags) stub_c_output_w
+ ("#define IN_STG_CODE 0\n" ++
+ new_fhdrs ++
+ "#include \"RtsAPI.h\"\n" ++
+ cplusplus_hdr)
+ cplusplus_ftr
+ -- We're adding the default hc_header to the stub file, but this
+ -- isn't really HC code, so we need to define IN_STG_CODE==0 to
+ -- avoid the register variables etc. being enabled.
+
+ return (stub_h_file_exists, stub_c_file_exists)