mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 09:17:35 +02:00
Set Cyc_global_variables correctly in lib2
This commit is contained in:
parent
2e16c27b42
commit
1eb8a22995
1 changed files with 5 additions and 3 deletions
8
cgen.scm
8
cgen.scm
|
@ -977,7 +977,7 @@
|
||||||
(emit "static void c_entry_pt(argc, env,cont) int argc; closure env,cont; { "))
|
(emit "static void c_entry_pt(argc, env,cont) int argc; closure env,cont; { "))
|
||||||
(else
|
(else
|
||||||
(emit (string-append "void c_" (lib:name->string lib-name) "_entry_pt(argc, env,cont) int argc; closure env,cont; { "))
|
(emit (string-append "void c_" (lib:name->string lib-name) "_entry_pt(argc, env,cont) int argc; closure env,cont; { "))
|
||||||
(emit (string-append "printf(\"init " (lib:name->string lib-name) "\\n\");"))
|
;DEBUG: (emit (string-append "printf(\"init " (lib:name->string lib-name) "\\n\");"))
|
||||||
))
|
))
|
||||||
|
|
||||||
;; Initialize global table
|
;; Initialize global table
|
||||||
|
@ -1038,6 +1038,8 @@
|
||||||
(emits str))
|
(emits str))
|
||||||
code))
|
code))
|
||||||
((null? (cdr ps))
|
((null? (cdr ps))
|
||||||
|
(if (not head-pair)
|
||||||
|
(set! head-pair (car cs)))
|
||||||
(loop (cons (string-append "make_cons(" (car cs) ", &" (car ps) ",Cyc_global_variables);\n") code)
|
(loop (cons (string-append "make_cons(" (car cs) ", &" (car ps) ",Cyc_global_variables);\n") code)
|
||||||
(cdr ps)
|
(cdr ps)
|
||||||
(cdr cs)))
|
(cdr cs)))
|
||||||
|
@ -1048,7 +1050,7 @@
|
||||||
(cdr ps)
|
(cdr ps)
|
||||||
(cdr cs)))))
|
(cdr cs)))))
|
||||||
(if head-pair
|
(if head-pair
|
||||||
(emits
|
(emit
|
||||||
(string-append "Cyc_global_variables = &" head-pair ";"))))
|
(string-append "Cyc_global_variables = &" head-pair ";"))))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
|
@ -1076,7 +1078,7 @@
|
||||||
(string-append "(" this-clo ".fn)(0, &" this-clo ", &" this-clo ");"))
|
(string-append "(" this-clo ".fn)(0, &" this-clo ", &" this-clo ");"))
|
||||||
(emit "}")
|
(emit "}")
|
||||||
(emit "static void c_entry_pt_first_lambda(int argc, closure env, closure cont) {")
|
(emit "static void c_entry_pt_first_lambda(int argc, closure env, closure cont) {")
|
||||||
(emit (string-append "printf(\"init first lambda\\n\");"))
|
;DEBUG: (emit (string-append "printf(\"init first lambda\\n\");"))
|
||||||
(emit compiled-program)))
|
(emit compiled-program)))
|
||||||
(else
|
(else
|
||||||
;; Do not use funcall1 macro as it might not have been defined
|
;; Do not use funcall1 macro as it might not have been defined
|
||||||
|
|
Loading…
Add table
Reference in a new issue