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

ruby-changes:27217

From: nobu <ko1@a...>
Date: Sat, 16 Feb 2013 12:47:31 +0900 (JST)
Subject: [ruby-changes:27217] nobu:r39269 (trunk): io/console: compatibility with 1.8

nobu	2013-02-16 12:47:21 +0900 (Sat, 16 Feb 2013)

  New Revision: 39269

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39269

  Log:
    io/console: compatibility with 1.8
    
    * ext/io/console/console.c (console_dev): compatibility with ruby 1.8.

  Modified files:
    trunk/ChangeLog
    trunk/ext/io/console/console.c
    trunk/ext/io/console/extconf.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39268)
+++ ChangeLog	(revision 39269)
@@ -1,4 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
-Sat Feb 16 12:46:32 2013  Nobuyoshi Nakada  <nobu@r...>
+Sat Feb 16 12:47:19 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* ext/io/console/console.c (console_dev): compatibility with ruby 1.8.
 
 	* ext/io/console/console.c (rawmode_opt, console_dev): compatibility
 	  with ruby 1.9.  [ruby-core:52220] [Bug #7847]
Index: ext/io/console/console.c
===================================================================
--- ext/io/console/console.c	(revision 39268)
+++ ext/io/console/console.c	(revision 39269)
@@ -7,6 +7,8 @@ https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L7
 #include "ruby/io.h"
 #else
 #include "rubyio.h"
+/* assumes rb_io_t doesn't have pathv */
+#include "util.h"		/* for ruby_strdup() */
 #endif
 
 #ifndef HAVE_RB_IO_T
@@ -742,7 +744,11 @@ console_dev(VALUE klass) https://github.com/ruby/ruby/blob/trunk/ext/io/console/console.c#L744
 	args[0] = INT2NUM(fd);
 	con = rb_class_new_instance(2, args, klass);
 	GetOpenFile(con, fptr);
+#ifdef HAVE_RUBY_IO_H
 	fptr->pathv = rb_obj_freeze(rb_str_new2(CONSOLE_DEVICE));
+#else
+	fptr->path = ruby_strdup(CONSOLE_DEVICE);
+#endif
 #ifdef CONSOLE_DEVICE_FOR_WRITING
 	GetOpenFile(out, ofptr);
 # ifdef HAVE_RB_IO_GET_WRITE_IO
Index: ext/io/console/extconf.rb
===================================================================
--- ext/io/console/extconf.rb	(revision 39268)
+++ ext/io/console/extconf.rb	(revision 39269)
@@ -12,6 +12,8 @@ when have_header(hdr = "sgtty.h") https://github.com/ruby/ruby/blob/trunk/ext/io/console/extconf.rb#L12
 else
   ok = false
 end
+ok &&= enable_config("io-console-force-compatible-with-1.8") ||
+  macro_defined?("HAVE_RUBY_IO_H", "ruby.h")
 if ok
   have_header("sys/ioctl.h")
   have_func("rb_check_hash_type", "ruby.h")

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

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