on master help sign in
Made generating C headers more declarative
c4e7ba2Daniel Waterworth
src/IRTS/CodegenC.hs+4−3
@@ -59,9 +59,10 @@ codegenC defs out exec incs objs libs dbg
59 when (exit /= ExitSuccess) $
59 when (exit /= ExitSuccess) $
60 putStrLn ("FAILURE: " ++ gcc)
60 putStrLn ("FAILURE: " ++ gcc)
61
61
62+headers xs =
63+ concatMap
64+ (\h -> "#include <" ++ h ++ ">\n")
62−headers [] = "#include <idris_rts.h>\n#include <idris_stdfgn.h>\n" ++
65+ (xs ++ ["idris_rts.h", "idris_stdfgn.h", "gmp.h", "assert.h"])
63− "#include <gmp.h>\n#include <assert.h>\n"
64−headers (x : xs) = "#include <" ++ x ++ ">\n" ++ headers xs
65
66
66debug TRACE = "#define IDRIS_TRACE\n\n"
67debug TRACE = "#define IDRIS_TRACE\n\n"
67debug _ = ""
68debug _ = ""