about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-11-21 18:24:46 +0000
committerEric Wong <normalperson@yhbt.net>2013-11-21 18:24:46 +0000
commit25e4c572eb30e2caae6528ef4f2b784fe5540aff (patch)
tree5794581f005acababb5d4af187ddbca5c6b0c7cf
parent099f4464e034e76d46493dae8fc211fdd93c9127 (diff)
downloadsleepy_penguin-25e4c572eb30e2caae6528ef4f2b784fe5540aff.tar.gz
https://github.com/rubinius/rubinius/issues/2771
-rw-r--r--ext/sleepy_penguin/util.c8
1 files changed, 8 insertions, 0 deletions
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);