Skip to content

Commit 0bbc9d7

Browse files
nobudenofevil
authored andcommitted
check necessary functions.
1 parent 0ffb349 commit 0bbc9d7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

ext/ruby_debug/extconf.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
have_struct_member("rb_method_entry_t", "called_id", "method.h") or
77
have_struct_member("rb_control_frame_t", "method_id", "method.h")
88
end and
9+
begin
10+
have_func("rb_method_entry", "method.h") or
11+
have_func("rb_method_node", "node.h")
12+
end and
913
have_header("vm_core.h") and have_header("iseq.h") and have_header("insns.inc") and
1014
have_header("insns_info.inc") and have_header("eval_intern.h")
1115
}
1216

13-
if RUBY_VERSION == '1.9.1'
14-
$CFLAGS << ' -DRUBY_VERSION_1_9_1'
15-
end
16-
1717
if RUBY_REVISION >= 26959 # rb_iseq_compile_with_option was added an argument filepath
1818
$CFLAGS << ' -DRB_ISEQ_COMPILE_6ARGS'
1919
end

ext/ruby_debug/ruby_debug.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ real_class(VALUE klass)
137137
inline static void *
138138
ruby_method_ptr(VALUE class, ID meth_id)
139139
{
140-
#ifdef RUBY_VERSION_1_9_1
140+
#ifndef HAVE_RB_METHOD_ENTRY
141141
NODE *body, *method;
142142
st_lookup(RCLASS_M_TBL(class), meth_id, (st_data_t *)&body);
143143
method = (NODE *)body->u2.value;
@@ -726,7 +726,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
726726
char *file = (char*)rb_sourcefile();
727727
int line = rb_sourceline();
728728
int moved = 0;
729-
#ifdef RUBY_VERSION_1_9_1
729+
#ifndef HAVE_RB_METHOD_ENTRY
730730
NODE *node = NULL;
731731
#else
732732
rb_method_entry_t *me = NULL;
@@ -748,7 +748,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
748748

749749
if (mid == ID_ALLOCATOR) return;
750750

751-
#ifdef RUBY_VERSION_1_9_1
751+
#ifndef HAVE_RB_METHOD_ENTRY
752752
node = rb_method_node(klass, mid);
753753
#else
754754
me = rb_method_entry(klass, mid);
@@ -964,7 +964,7 @@ debug_event_hook(rb_event_flag_t event, VALUE data, VALUE self, ID mid, VALUE kl
964964
case RUBY_EVENT_C_RETURN:
965965
{
966966
/* note if a block is given we fall through! */
967-
#ifdef RUBY_VERSION_1_9_1
967+
#ifndef HAVE_RB_METHOD_ENTRY
968968
if(!node || !c_call_new_frame_p(klass, mid))
969969
#else
970970
if(!me || !c_call_new_frame_p(klass, mid))

0 commit comments

Comments
 (0)