io/console: compatibility with 1.8
* ext/io/console/console.c (console_dev): compatibility with ruby 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
44c24d4416
commit
6ba2001d72
@ -1,4 +1,6 @@
|
|||||||
Sat Feb 16 12:46:32 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Feb 16 12:47:19 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/io/console/console.c (console_dev): compatibility with ruby 1.8.
|
||||||
|
|
||||||
* ext/io/console/console.c (rawmode_opt, console_dev): compatibility
|
* ext/io/console/console.c (rawmode_opt, console_dev): compatibility
|
||||||
with ruby 1.9. [ruby-core:52220] [Bug #7847]
|
with ruby 1.9. [ruby-core:52220] [Bug #7847]
|
||||||
|
@ -7,6 +7,8 @@
|
|||||||
#include "ruby/io.h"
|
#include "ruby/io.h"
|
||||||
#else
|
#else
|
||||||
#include "rubyio.h"
|
#include "rubyio.h"
|
||||||
|
/* assumes rb_io_t doesn't have pathv */
|
||||||
|
#include "util.h" /* for ruby_strdup() */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_RB_IO_T
|
#ifndef HAVE_RB_IO_T
|
||||||
@ -742,7 +744,11 @@ console_dev(VALUE klass)
|
|||||||
args[0] = INT2NUM(fd);
|
args[0] = INT2NUM(fd);
|
||||||
con = rb_class_new_instance(2, args, klass);
|
con = rb_class_new_instance(2, args, klass);
|
||||||
GetOpenFile(con, fptr);
|
GetOpenFile(con, fptr);
|
||||||
|
#ifdef HAVE_RUBY_IO_H
|
||||||
fptr->pathv = rb_obj_freeze(rb_str_new2(CONSOLE_DEVICE));
|
fptr->pathv = rb_obj_freeze(rb_str_new2(CONSOLE_DEVICE));
|
||||||
|
#else
|
||||||
|
fptr->path = ruby_strdup(CONSOLE_DEVICE);
|
||||||
|
#endif
|
||||||
#ifdef CONSOLE_DEVICE_FOR_WRITING
|
#ifdef CONSOLE_DEVICE_FOR_WRITING
|
||||||
GetOpenFile(out, ofptr);
|
GetOpenFile(out, ofptr);
|
||||||
# ifdef HAVE_RB_IO_GET_WRITE_IO
|
# ifdef HAVE_RB_IO_GET_WRITE_IO
|
||||||
|
@ -12,6 +12,8 @@ when have_header(hdr = "sgtty.h")
|
|||||||
else
|
else
|
||||||
ok = false
|
ok = false
|
||||||
end
|
end
|
||||||
|
ok &&= enable_config("io-console-force-compatible-with-1.8") ||
|
||||||
|
macro_defined?("HAVE_RUBY_IO_H", "ruby.h")
|
||||||
if ok
|
if ok
|
||||||
have_header("sys/ioctl.h")
|
have_header("sys/ioctl.h")
|
||||||
have_func("rb_check_hash_type", "ruby.h")
|
have_func("rb_check_hash_type", "ruby.h")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user