diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | eval_intern.h | 9 | ||||
-rw-r--r-- | thread.c | 11 |
3 files changed, 16 insertions, 11 deletions
@@ -1,3 +1,10 @@ +Wed Feb 7 22:41:34 2007 Koichi Sasada <ko1@atdot.net> + + * eval_intern.h: remove UNSUPPORTED() macro. + + * thread.c: fix to define Continuation methods + (they only do rb_notimplement()). + Wed Feb 7 22:33:58 2007 Koichi Sasada <ko1@atdot.net> * eval_intern.h, yarvcore.h: remove unused macro definition. diff --git a/eval_intern.h b/eval_intern.h index e68764191f..0407b0bb92 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -6,15 +6,6 @@ (GET_THREAD()->passed_block = \ GC_GUARDED_PTR_REF((rb_block_t *)GET_THREAD()->cfp->lfp[0])) - -#define UNSUPPORTED(func) \ -{ \ - int *a = 0; \ - fprintf(stderr, "%s", "-- unsupported: " #func "\n"); fflush(stderr); \ - *a = 0; \ - rb_bug("unsupported: " #func); \ -} - #include "ruby.h" #include "node.h" #include "util.h" @@ -2171,7 +2171,7 @@ VALUE rb_cCont; static VALUE rb_callcc(VALUE self) { - UNSUPPORTED(rb_callcc); + rb_notimplement(); return Qnil; } @@ -2194,7 +2194,8 @@ rb_callcc(VALUE self) static VALUE rb_cont_call(int argc, VALUE *argv, VALUE cont) { - UNSUPPORTED(rb_cont_call); + rb_notimplement(); + return Qnil; } /* variables for recursive traversals */ @@ -2371,7 +2372,13 @@ Init_Thread(void) recursive_key = rb_intern("__recursive_key__"); rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError); + rb_cCont = rb_define_class("Continuation", rb_cObject); + rb_undef_alloc_func(rb_cCont); + rb_undef_method(CLASS_OF(rb_cCont), "new"); + rb_define_method(rb_cCont, "call", rb_cont_call, -1); + rb_define_method(rb_cCont, "[]", rb_cont_call, -1); + rb_define_global_function("callcc", rb_callcc, 0); Init_native_thread(); { |