mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 04:25:06 +02:00
Output C headers
This commit is contained in:
parent
ea37de65f7
commit
61f42ef849
2 changed files with 11 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
||||||
(define-library (example life)
|
(define-library (example life)
|
||||||
(include-c-header "../write-png.h")
|
(include-c-header "../write-png.h")
|
||||||
|
;Or, if you want angle brackets: (include-c-header "<stdio.h>")
|
||||||
(export life)
|
(export life)
|
||||||
(import (scheme base) ;TODO: (except (scheme base) set!)
|
(import (scheme base) ;TODO: (except (scheme base) set!)
|
||||||
(scheme write)
|
(scheme write)
|
||||||
|
|
|
@ -1412,6 +1412,16 @@
|
||||||
(foldr string-append "" (reverse compiled-program-lst)))
|
(foldr string-append "" (reverse compiled-program-lst)))
|
||||||
|
|
||||||
(emit-c-arity-macros 0)
|
(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\"")
|
(emit "#include \"cyclone/types.h\"")
|
||||||
|
|
||||||
;; Globals defined in this module
|
;; Globals defined in this module
|
||||||
|
|
Loading…
Add table
Reference in a new issue