Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
cbf8c1c9
Commit
cbf8c1c9
authored
26 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-11-08 17:10:00 by sof]
include 'foreign export' prototypes in generated .c file
parent
9aed2f5f
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/main/Main.lhs
+12
-4
12 additions, 4 deletions
ghc/compiler/main/Main.lhs
with
12 additions
and
4 deletions
ghc/compiler/main/Main.lhs
+
12
−
4
View file @
cbf8c1c9
...
...
@@ -252,10 +252,10 @@ doIt (core_cmds, stg_cmds) =
doOutput opt_ProduceC c_output_w >>
dumpIfSet opt_D_dump_foreign "Foreign export header file" stub_h_output_d >>
outputStub opt_ProduceExportHStubs stub_h_output_w >>
output
H
Stub opt_ProduceExportHStubs stub_h_output_w >>
dumpIfSet opt_D_dump_foreign "Foreign export stubs" stub_c_output_d >>
outputStub opt_ProduceExportCStubs stub_c_output_w >>
output
C
Stub
mod_name
opt_ProduceExportCStubs stub_c_output_w >>
reportCompile (_UNPK_ mod_name) (showSDoc (ppSourceStats True rdr_module)) >>
...
...
@@ -281,8 +281,16 @@ doIt (core_cmds, stg_cmds) =
-- don't use doOutput for dumping the f. export stubs
-- since it is more than likely that the stubs file will
-- turn out to be empty, in which case no file should be created.
outputStub switch "" = return ()
outputStub switch doc_str
outputCStub mod_name switch "" = return ()
outputCStub mod_name switch doc_str
= case switch of
Nothing -> return ()
Just fname -> writeFile fname ("#include \"rtsdefs.h\"\n"++rest)
where
rest = "#include "++show ((_UNPK_ mod_name) ++ "_stub.h") ++ '\n':doc_str
outputHStub switch "" = return ()
outputHStub switch doc_str
= case switch of
Nothing -> return ()
Just fname -> writeFile fname ("#include \"rtsdefs.h\"\n"++doc_str)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment