Skip to content

Commit 57ee692

Browse files
authored
Add runtime.h to generated C file again
1 parent 56eee0f commit 57ee692

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/scala/fred/Compiler.scala

+3-4
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ object Compiler {
7676
.getResourceAsStream(RuntimeHeader)
7777
val io = ProcessIO(
7878
in => {
79-
in.write(generated.getBytes())
80-
// in.write(runtimeHeader.readAllBytes())
79+
in.write(runtimeHeader.readAllBytes())
8180
// TODO removing #include runtime.h is a horrendous hack
82-
// in.write(generated.replaceAll("#include \"runtime.h\"", "").getBytes())
81+
in.write(generated.replaceAll("#include \"runtime.h\"", "").getBytes())
8382
in.close()
8483
},
8584
out => print(String(out.readAllBytes())),
@@ -89,7 +88,7 @@ object Compiler {
8988
val extraIncludes =
9089
if (settings.includeMemcheck) "-I /usr/include/valgrind" else ""
9190

92-
assert(s"gcc -g -I ${includesFolder()} $extraIncludes -o $outExe -x c -".run(io).exitValue() == 0)
91+
assert(s"gcc -g $extraIncludes -o $outExe -x c -".run(io).exitValue() == 0)
9392
File(outExe).setExecutable(true)
9493

9594
runtimeHeader.close()

0 commit comments

Comments
 (0)