1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

io/console: use rb_funcallv

* ext/io/console/console.c: use rb_funcallv instead of
  rb_funcall2, and define rb_funcallv if unavailable.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-04-15 00:02:43 +00:00
parent c88d0666d4
commit cc91082af8
2 changed files with 6 additions and 2 deletions

View file

@ -17,6 +17,9 @@
#ifndef RARRAY_CONST_PTR
# define RARRAY_CONST_PTR(ary) RARRAY_PTR(ary)
#endif
#ifndef HAVE_RB_FUNCALLV
# define rb_funcallv rb_funcall2
#endif
#if defined HAVE_TERMIOS_H
# include <termios.h>
@ -381,7 +384,7 @@ console_set_cooked(VALUE io)
static VALUE
getc_call(VALUE io)
{
return rb_funcall2(io, id_getc, 0, 0);
return rb_funcallv(io, id_getc, 0, 0);
}
/*
@ -846,7 +849,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
static VALUE
io_getch(int argc, VALUE *argv, VALUE io)
{
return rb_funcall2(io, id_getc, argc, argv);
return rb_funcallv(io, id_getc, argc, argv);
}
#if ENABLE_IO_GETPASS

View file

@ -17,6 +17,7 @@ else
end
if ok
have_header("sys/ioctl.h") if hdr
have_func("rb_funcallv")
# rb_check_hash_type: 1.9.3
# rb_io_get_write_io: 1.9.1
# rb_cloexec_open: 2.0.0