diff options
Diffstat (limited to 'ext/io/console')
-rw-r--r-- | ext/io/console/console.c | 7 | ||||
-rw-r--r-- | ext/io/console/extconf.rb | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 2e2467036d..6999a3f077 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -80,8 +80,11 @@ static ID id_getc, id_console, id_close, id_min, id_time, id_intr; static ID id_gets, id_chomp_bang; #endif -#ifdef HAVE_RB_SCHEDULER_TIMEOUT +#if defined HAVE_RUBY_FIBER_SCHEDULER_H +# include "ruby/fiber/scheduler.h" +#elif defined HAVE_RB_SCHEDULER_TIMEOUT extern VALUE rb_scheduler_timeout(struct timeval *timeout); +# define rb_fiber_scheduler_timeout rb_scheduler_timeout #endif #define sys_fail_fptr(fptr) rb_sys_fail_str((fptr)->pathv) @@ -534,7 +537,7 @@ console_getch(int argc, VALUE *argv, VALUE io) tv.tv_sec = optp->vtime / 10; tv.tv_usec = (optp->vtime % 10) * 100000; # ifdef HAVE_RB_IO_WAIT - timeout = rb_scheduler_timeout(&tv); + timeout = rb_fiber_scheduler_make_timeout(&tv); # endif } switch (optp->vmin) { diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb index 3efdd6e092..40af8c0b72 100644 --- a/ext/io/console/extconf.rb +++ b/ext/io/console/extconf.rb @@ -24,7 +24,7 @@ when true # rb_funcallv: 2.1.0 # RARRAY_CONST_PTR: 2.1.0 # rb_sym2str: 2.2.0 - if have_func("rb_scheduler_timeout") + if have_func("rb_fiber_scheduler_make_timeout") have_func("rb_io_wait") end $defs << "-D""ENABLE_IO_GETPASS=1" |