From 25e4c572eb30e2caae6528ef4f2b784fe5540aff Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 21 Nov 2013 18:24:46 +0000 Subject: work around lack of rb_io_get_io in Rubinius https://github.com/rubinius/rubinius/issues/2771 --- ext/sleepy_penguin/util.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext/sleepy_penguin') diff --git a/ext/sleepy_penguin/util.c b/ext/sleepy_penguin/util.c index 9d2123f..2c17e1a 100644 --- a/ext/sleepy_penguin/util.c +++ b/ext/sleepy_penguin/util.c @@ -1,5 +1,13 @@ #include "sleepy_penguin.h" +#ifndef HAVE_RB_IO_GET_IO +static VALUE my_io_get_io(VALUE io) +{ + return rb_convert_type(io, T_FILE, "IO", "to_io"); +} +# define rb_io_get_io(io) my_io_get_io((io)) +#endif /* HAVE_RB_IO_GET_IO */ + static VALUE klass_for(VALUE klass) { return (TYPE(klass) == T_CLASS) ? klass : CLASS_OF(klass); -- cgit v1.2.3-24-ge0c7