From e0f6f917a87c574c8d2a3764060436fd3ac1cad0 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 31 Mar 2016 22:06:56 -0400 Subject: [PATCH] Handle new naming of globals --- include/cyclone/runtime.h | 13 +++++-------- runtime.c | 9 ++++----- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index aee80aee..4c7c8613 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -403,26 +403,23 @@ extern const object primitive_call_95cc; /** Globals that are needed by the runtime * What's going on here is the globals are defined by a module, but - * are also used by the runtime. At least for now, these macros are - * used to point everybody to the objects, which are used by both - * those libraries and this module. + * are also used by the runtime. At least for now, macros below are + * used to point everybody to the objects. * * The assumption for now is that a program that does not include * the necessary libray would never use the corresponding function. */ -extern object Cyc_glo_eval; extern object Cyc_glo_eval_from_c; extern object Cyc_glo_call_cc; -#define __glo_eval Cyc_glo_eval -#define __glo_eval_91from_91c Cyc_glo_eval_from_c -#define __glo_call_95cc Cyc_glo_call_cc +#define __glo_eval_91from_91c_scheme_eval Cyc_glo_eval_from_c +#define __glo_call_95cc_scheme_base Cyc_glo_call_cc +/* Exception handling */ object Cyc_default_exception_handler(void *data, int argc, closure _, object err); object Cyc_current_exception_handler(void *data); void Cyc_rt_raise(void *data, object err); void Cyc_rt_raise2(void *data, const char *msg, object err); void Cyc_rt_raise_msg(void *data, const char *err); -/* END exception handler */ #endif /* CYCLONE_RUNTIME_H */ diff --git a/runtime.c b/runtime.c index 9a0c5999..21d9dcb1 100644 --- a/runtime.c +++ b/runtime.c @@ -348,7 +348,6 @@ void clear_mutations(void *data) { /* Runtime globals */ object Cyc_glo_call_cc = nil; -object Cyc_glo_eval = nil; object Cyc_glo_eval_from_c = nil; /* Exception handler */ @@ -2367,7 +2366,7 @@ void _call_95cc(void *data, object cont, object args){ if (eq(boolean_f, Cyc_is_procedure(data, car(args)))) { Cyc_invalid_type_error(data, closure1_tag, car(args)); } - return_closcall2(data, __glo_call_95cc, cont, car(args)); + return_closcall2(data, __glo_call_95cc_scheme_base, cont, car(args)); } /* @@ -2423,17 +2422,17 @@ object apply(void *data, object cont, object func, object args){ make_cons(c, func, args); //printf("JAE DEBUG, sending to eval: "); //Cyc_display(&c, stderr); - ((closure)__glo_eval_91from_91c)->fn(data, 2, __glo_eval_91from_91c, cont, &c, nil); + ((closure)Cyc_glo_eval_from_c)->fn(data, 2, Cyc_glo_eval_from_c, cont, &c, nil); // TODO: would be better to compare directly against symbols here, // but need a way of looking them up ahead of time. // maybe a libinit() or such is required. } else if (strncmp(((symbol)fobj)->pname, "primitive", 10) == 0) { make_cons(c, cadr(func), args); - ((closure)__glo_eval_91from_91c)->fn(data, 3, __glo_eval_91from_91c, cont, &c, nil); + ((closure)Cyc_glo_eval_from_c)->fn(data, 3, Cyc_glo_eval_from_c, cont, &c, nil); } else if (strncmp(((symbol)fobj)->pname, "procedure", 10) == 0) { make_cons(c, func, args); - ((closure)__glo_eval_91from_91c)->fn(data, 3, __glo_eval_91from_91c, cont, &c, nil); + ((closure)Cyc_glo_eval_from_c)->fn(data, 3, Cyc_glo_eval_from_c, cont, &c, nil); } else { make_cons(c, func, args); Cyc_rt_raise2(data, "Unable to evaluate: ", &c);