|
2 | 2 | require_relative '../../lib/debug/version' |
3 | 3 | File.write("debug_version.h", "#define RUBY_DEBUG_VERSION \"#{DEBUGGER__::VERSION}\"\n") |
4 | 4 |
|
5 | | -have_func "rb_iseq_parameters(NULL, 0)", |
6 | | - [["VALUE rb_iseq_parameters(void *, int is_proc);"]] |
7 | 5 |
|
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' |
10 | 9 |
|
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 |
14 | 25 |
|
15 | 26 | create_makefile 'debug/debug' |
0 commit comments