Skip to content

Commit 1fce258

Browse files
committed
skip feature check on MRI
On MRI, `rb_iseq_parameters` and `rb_iseq_code_location` are supported on at least ruby 2.6 and later, and `rb_iseq_type` is supported on 3.1.0 and later. This commit skips `have_func` check (checked by `RUBY_VERSION`).
1 parent 5d16d87 commit 1fce258

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

ext/debug/extconf.rb

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,25 @@
22
require_relative '../../lib/debug/version'
33
File.write("debug_version.h", "#define RUBY_DEBUG_VERSION \"#{DEBUGGER__::VERSION}\"\n")
44

5-
have_func "rb_iseq_parameters(NULL, 0)",
6-
[["VALUE rb_iseq_parameters(void *, int is_proc);"]]
75

8-
have_func "rb_iseq_code_location(NULL, NULL, NULL, NULL, NULL)",
9-
[["void rb_iseq_code_location(void *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);"]]
6+
if defined? RubyVM
7+
$defs << '-DHAVE_RB_ISEQ_PARAMETERS'
8+
$defs << '-DHAVE_RB_ISEQ_CODE_LOCATION'
109

11-
# from Ruby 3.1
12-
have_func "rb_iseq_type(NULL)",
13-
[["VALUE rb_iseq_type(void *);"]]
10+
if RUBY_VERSION >= '3.1.0'
11+
$defs << '-DHAVE_RB_ISEQ_TYPE'
12+
end
13+
else
14+
# not on MRI
15+
16+
have_func "rb_iseq_parameters(NULL, 0)",
17+
[["VALUE rb_iseq_parameters(void *, int is_proc);"]]
18+
19+
have_func "rb_iseq_code_location(NULL, NULL, NULL, NULL, NULL)",
20+
[["void rb_iseq_code_location(void *, int *first_lineno, int *first_column, int *last_lineno, int *last_column);"]]
21+
# from Ruby 3.1
22+
have_func "rb_iseq_type(NULL)",
23+
[["VALUE rb_iseq_type(void *);"]]
24+
end
1425

1526
create_makefile 'debug/debug'

0 commit comments

Comments
 (0)