Output C headers

This commit is contained in:
Justin Ethier 2016-04-20 00:04:00 -04:00
parent ea37de65f7
commit 61f42ef849
2 changed files with 11 additions and 0 deletions

View file

@ -1,5 +1,6 @@
(define-library (example life)
(include-c-header "../write-png.h")
;Or, if you want angle brackets: (include-c-header "<stdio.h>")
(export life)
(import (scheme base) ;TODO: (except (scheme base) set!)
(scheme write)

View file

@ -1412,6 +1412,16 @@
(foldr string-append "" (reverse compiled-program-lst)))
(emit-c-arity-macros 0)
(for-each
(lambda (h)
(cond
((and (string? h)
(> (string-length h) 0)
(equal? (string-ref h 0) #\<))
(emit* "#include " h ""))
(else
(emit* "#include \"" h "\""))))
c-headers)
(emit "#include \"cyclone/types.h\"")
;; Globals defined in this module