[前][次][番号順一覧][スレッド一覧]

ruby-changes:42512

From: nobu <ko1@a...>
Date: Fri, 15 Apr 2016 08:06:08 +0900 (JST)
Subject: [ruby-changes:42512] nobu:r54586 (trunk): io/console: use rb_funcallv

nobu	2016-04-15 09:02:43 +0900 (Fri, 15 Apr 2016)

  New Revision: 54586

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54586

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

  Modified files:
    trunk/ext/io/console/console.c
    trunk/ext/io/console/extconf.rb
Index: ext/io/console/console.c
===================================================================
--- ext/io/console/console.c	(revision 54585)
+++ ext/io/console/console.c	(revision 54586)
@@ -17,6 +17,9 @@ https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L17
 #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) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L384
 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 https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L849
 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
Index: ext/io/console/extconf.rb
===================================================================
--- ext/io/console/extconf.rb	(revision 54585)
+++ ext/io/console/extconf.rb	(revision 54586)
@@ -17,6 +17,7 @@ else https://github.com/ruby/ruby/blob/trunk/ext/io/console/extconf.rb#L17
 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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]