mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-19 05:39:17 +02:00
Fixup to use new runtime
This commit is contained in:
parent
59bc8cdf4b
commit
355e11260d
2 changed files with 9 additions and 22 deletions
|
@ -223,13 +223,6 @@
|
||||||
/*
|
/*
|
||||||
"---------------- C code:"
|
"---------------- C code:"
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GC_GLOBALS \
|
|
||||||
{ \
|
|
||||||
transp(__glo_lib2_91hello); \
|
|
||||||
transp(__glo__85exception_91handler_91stack_85); \
|
|
||||||
transp(__glo_call_95cc);}
|
|
||||||
|
|
||||||
#define funcall0(cfn) ((cfn)->fn)(0,cfn)
|
#define funcall0(cfn) ((cfn)->fn)(0,cfn)
|
||||||
/* Return to continuation after checking for stack overflow. */
|
/* Return to continuation after checking for stack overflow. */
|
||||||
#define return_funcall0(cfn) \
|
#define return_funcall0(cfn) \
|
||||||
|
@ -284,18 +277,14 @@
|
||||||
GC(&c1, buf, 2); return; \
|
GC(&c1, buf, 2); return; \
|
||||||
} else { (_fn)(2,(closure)_fn,a1,a2); }}
|
} else { (_fn)(2,(closure)_fn,a1,a2); }}
|
||||||
|
|
||||||
|
|
||||||
#include "cyclone.h"
|
#include "cyclone.h"
|
||||||
|
object __glo_lib2_91hello = nil;
|
||||||
|
object __glo__85exception_91handler_91stack_85 = nil;
|
||||||
|
object __glo_call_95cc = nil;
|
||||||
|
|
||||||
#define DECLARE_GLOBALS \
|
|
||||||
static volatile object __glo_lib2_91hello = nil; \
|
|
||||||
static volatile object __glo__85exception_91handler_91stack_85 = nil; \
|
|
||||||
static volatile object __glo_call_95cc = nil;
|
|
||||||
DECLARE_GLOBALS
|
|
||||||
|
|
||||||
#include "runtime.h"
|
#include "runtime.h"
|
||||||
#include "runtime-main.h"
|
#include "runtime-main.h"
|
||||||
|
|
||||||
static void __lambda_4(int argc, closure _) ;
|
static void __lambda_4(int argc, closure _) ;
|
||||||
static void __lambda_3(int argc, closure _,object r_736) ;
|
static void __lambda_3(int argc, closure _,object r_736) ;
|
||||||
static void __lambda_2(int argc, closure _,object r_735) ;
|
static void __lambda_2(int argc, closure _,object r_735) ;
|
||||||
|
@ -332,10 +321,10 @@ static void __lambda_0(int argc, object self_737, object _191, object result) {
|
||||||
|
|
||||||
|
|
||||||
static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
|
static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
|
||||||
|
|
||||||
add_global((object *) &__glo_lib2_91hello);
|
add_global((object *) &__glo_lib2_91hello);
|
||||||
add_global((object *) &__glo__85exception_91handler_91stack_85);
|
add_global((object *) &__glo__85exception_91handler_91stack_85);
|
||||||
add_global((object *) &__glo_call_95cc);
|
add_global((object *) &__glo_call_95cc);
|
||||||
|
|
||||||
mclosure0(c_738, (function_type)__lambda_1);
|
mclosure0(c_738, (function_type)__lambda_1);
|
||||||
__glo_call_95cc = &c_738;
|
__glo_call_95cc = &c_738;
|
||||||
make_string(c_7313, "Hello from library #2");
|
make_string(c_7313, "Hello from library #2");
|
||||||
|
|
|
@ -213,13 +213,6 @@
|
||||||
/*
|
/*
|
||||||
"---------------- C code:"
|
"---------------- C code:"
|
||||||
*/
|
*/
|
||||||
#define DECLARE_LIB2_GLOBALS \
|
|
||||||
object __glo_lib2_91hello = nil;
|
|
||||||
//static volatile object __glo_lib2_91hello = nil;
|
|
||||||
|
|
||||||
#define GC_LIB2_GLOBALS \
|
|
||||||
{ \
|
|
||||||
transp(__glo_lib2_91hello);}
|
|
||||||
|
|
||||||
#define funcall1(cfn,a1) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(0, (closure)a1, cfn); } else { ((cfn)->fn)(1,cfn,a1);}
|
#define funcall1(cfn,a1) if (type_of(cfn) == cons_tag || prim(cfn)) { Cyc_apply(0, (closure)a1, cfn); } else { ((cfn)->fn)(1,cfn,a1);}
|
||||||
/* Return to continuation after checking for stack overflow. */
|
/* Return to continuation after checking for stack overflow. */
|
||||||
|
@ -257,6 +250,10 @@
|
||||||
GC(&c1, buf, 2); return; \
|
GC(&c1, buf, 2); return; \
|
||||||
} else { (_fn)(2,(closure)_fn,a1,a2); }}
|
} else { (_fn)(2,(closure)_fn,a1,a2); }}
|
||||||
|
|
||||||
|
#include "cyclone.h"
|
||||||
|
|
||||||
|
object __glo_lib2_91hello = nil;
|
||||||
|
|
||||||
#include "runtime.h"
|
#include "runtime.h"
|
||||||
|
|
||||||
static void __lambda_2(int argc, closure _,object r_735) ;
|
static void __lambda_2(int argc, closure _,object r_735) ;
|
||||||
|
@ -288,6 +285,7 @@ static void __lambda_0(int argc, object self_736, object _191, object result) {
|
||||||
// static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
|
// static void c_entry_pt(argc, env,cont) int argc; closure env,cont; {
|
||||||
// mclosure0(c_737, (function_type)__lambda_1);
|
// mclosure0(c_737, (function_type)__lambda_1);
|
||||||
// __glo_call_95cc = &c_737;
|
// __glo_call_95cc = &c_737;
|
||||||
|
add_global((object *) &__glo_lib2_91hello);
|
||||||
make_string(c_7312, "Hello from library #2");
|
make_string(c_7312, "Hello from library #2");
|
||||||
__glo_lib2_91hello = &c_7312;
|
__glo_lib2_91hello = &c_7312;
|
||||||
// TODO: How to assign lib2 to Cyc_global_variables?
|
// TODO: How to assign lib2 to Cyc_global_variables?
|
||||||
|
|
Loading…
Add table
Reference in a new issue