diff options
Diffstat (limited to 'spec/ruby/optional/capi/ext/proc_spec.c')
-rw-r--r-- | spec/ruby/optional/capi/ext/proc_spec.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/spec/ruby/optional/capi/ext/proc_spec.c b/spec/ruby/optional/capi/ext/proc_spec.c index f9c0f6b1b9..67dd8577bd 100644 --- a/spec/ruby/optional/capi/ext/proc_spec.c +++ b/spec/ruby/optional/capi/ext/proc_spec.c @@ -7,7 +7,6 @@ extern "C" { #endif -#ifdef HAVE_RB_PROC_NEW VALUE proc_spec_rb_proc_new_function(VALUE args) { return rb_funcall(args, rb_intern("inspect"), 0); } @@ -15,19 +14,14 @@ VALUE proc_spec_rb_proc_new_function(VALUE args) { VALUE proc_spec_rb_proc_new(VALUE self) { return rb_proc_new(proc_spec_rb_proc_new_function, Qnil); } -#endif -#ifdef HAVE_RB_PROC_ARITY VALUE proc_spec_rb_proc_arity(VALUE self, VALUE prc) { return INT2FIX(rb_proc_arity(prc)); } -#endif -#ifdef HAVE_RB_PROC_CALL VALUE proc_spec_rb_proc_call(VALUE self, VALUE prc, VALUE args) { return rb_proc_call(prc, args); } -#endif /* This helper is not strictly necessary but reflects the code in wxRuby that * originally exposed issues with this Proc.new behavior. @@ -62,21 +56,10 @@ VALUE proc_spec_rb_Proc_new(VALUE self, VALUE scenario) { } void Init_proc_spec(void) { - VALUE cls; - cls = rb_define_class("CApiProcSpecs", rb_cObject); - -#ifdef HAVE_RB_PROC_NEW + VALUE cls = rb_define_class("CApiProcSpecs", rb_cObject); rb_define_method(cls, "rb_proc_new", proc_spec_rb_proc_new, 0); -#endif - -#ifdef HAVE_RB_PROC_ARITY rb_define_method(cls, "rb_proc_arity", proc_spec_rb_proc_arity, 1); -#endif - -#ifdef HAVE_RB_PROC_CALL rb_define_method(cls, "rb_proc_call", proc_spec_rb_proc_call, 2); -#endif - rb_define_method(cls, "rb_Proc_new", proc_spec_rb_Proc_new, 1); } |