diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-16 03:47:21 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-02-16 03:47:21 +0000 |
commit | 6ba2001d72c05c59bb973d7934c324263552b5c9 (patch) | |
tree | 634ed2325de75d0cb84cb16751ba7857a16a1bb1 /ext/io/console/console.c | |
parent | 44c24d4416a9c3f36010dcf0593e5dce21183d19 (diff) | |
download | ruby-6ba2001d72c05c59bb973d7934c324263552b5c9.tar.gz |
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
Diffstat (limited to 'ext/io/console/console.c')
-rw-r--r-- | ext/io/console/console.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 6c7a31b5e0..2e8f0e387e 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -7,6 +7,8 @@ #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) 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 |