From 355e11260db459e2f0c60f3e30d12a0645dbb246 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Fri, 8 May 2015 13:34:15 -0400 Subject: [PATCH] Fixup to use new runtime --- examples/hello-library/int-test/hello.c | 19 ++++--------------- examples/hello-library/int-test/lib2.c | 12 +++++------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/examples/hello-library/int-test/hello.c b/examples/hello-library/int-test/hello.c index 96b57533..1691150a 100644 --- a/examples/hello-library/int-test/hello.c +++ b/examples/hello-library/int-test/hello.c @@ -223,13 +223,6 @@ /* "---------------- 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) /* Return to continuation after checking for stack overflow. */ #define return_funcall0(cfn) \ @@ -284,18 +277,14 @@ GC(&c1, buf, 2); return; \ } else { (_fn)(2,(closure)_fn,a1,a2); }} - #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-main.h" - static void __lambda_4(int argc, closure _) ; static void __lambda_3(int argc, closure _,object r_736) ; 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; { + add_global((object *) &__glo_lib2_91hello); add_global((object *) &__glo__85exception_91handler_91stack_85); add_global((object *) &__glo_call_95cc); - mclosure0(c_738, (function_type)__lambda_1); __glo_call_95cc = &c_738; make_string(c_7313, "Hello from library #2"); diff --git a/examples/hello-library/int-test/lib2.c b/examples/hello-library/int-test/lib2.c index ee1c69b8..73d6d98e 100644 --- a/examples/hello-library/int-test/lib2.c +++ b/examples/hello-library/int-test/lib2.c @@ -213,13 +213,6 @@ /* "---------------- 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);} /* Return to continuation after checking for stack overflow. */ @@ -257,6 +250,10 @@ GC(&c1, buf, 2); return; \ } else { (_fn)(2,(closure)_fn,a1,a2); }} +#include "cyclone.h" + +object __glo_lib2_91hello = nil; + #include "runtime.h" 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; { // mclosure0(c_737, (function_type)__lambda_1); // __glo_call_95cc = &c_737; + add_global((object *) &__glo_lib2_91hello); make_string(c_7312, "Hello from library #2"); __glo_lib2_91hello = &c_7312; // TODO: How to assign lib2 to Cyc_global_variables?