mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 17:27:33 +02:00
Read c headers included by a library
This commit is contained in:
parent
c594cdadbe
commit
ea37de65f7
2 changed files with 7 additions and 0 deletions
|
@ -52,6 +52,7 @@
|
||||||
(define lib-name '())
|
(define lib-name '())
|
||||||
(define lib-exports '())
|
(define lib-exports '())
|
||||||
(define lib-renamed-exports '())
|
(define lib-renamed-exports '())
|
||||||
|
(define c-headers '())
|
||||||
|
|
||||||
(emit *c-file-header-comment*) ; Guarantee placement at top of C file
|
(emit *c-file-header-comment*) ; Guarantee placement at top of C file
|
||||||
|
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
(let ((includes (lib:includes (car input-program))))
|
(let ((includes (lib:includes (car input-program))))
|
||||||
(set! program? #f)
|
(set! program? #f)
|
||||||
(set! lib-name (lib:name (car input-program)))
|
(set! lib-name (lib:name (car input-program)))
|
||||||
|
(set! c-headers (lib:include-c-headers (car input-program)))
|
||||||
(set! lib-exports
|
(set! lib-exports
|
||||||
(cons
|
(cons
|
||||||
(lib:name->symbol lib-name)
|
(lib:name->symbol lib-name)
|
||||||
|
@ -262,6 +264,9 @@
|
||||||
(trace:error "DEBUG, existing program")
|
(trace:error "DEBUG, existing program")
|
||||||
(exit 0))
|
(exit 0))
|
||||||
|
|
||||||
|
(trace:info "---------------- C headers: ")
|
||||||
|
(trace:info c-headers)
|
||||||
|
|
||||||
(trace:info "---------------- C code:")
|
(trace:info "---------------- C code:")
|
||||||
(mta:code-gen input-program
|
(mta:code-gen input-program
|
||||||
program?
|
program?
|
||||||
|
@ -269,6 +274,7 @@
|
||||||
lib-exports
|
lib-exports
|
||||||
imported-vars
|
imported-vars
|
||||||
module-globals
|
module-globals
|
||||||
|
c-headers
|
||||||
lib-deps
|
lib-deps
|
||||||
src-file)
|
src-file)
|
||||||
(return '())))) ;; No codes to return
|
(return '())))) ;; No codes to return
|
||||||
|
|
|
@ -1370,6 +1370,7 @@
|
||||||
lib-exports
|
lib-exports
|
||||||
imported-globals
|
imported-globals
|
||||||
globals
|
globals
|
||||||
|
c-headers
|
||||||
required-libs
|
required-libs
|
||||||
src-file)
|
src-file)
|
||||||
(set! *global-syms* (append globals (lib:idb:ids imported-globals)))
|
(set! *global-syms* (append globals (lib:idb:ids imported-globals)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue