sleepy_penguin RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* [sleepy.penguin] [PATCH] work around lack of rb_io_get_io in Rubinius
@ 2013-11-21 18:48 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2013-11-21 18:48 UTC (permalink / raw)
  To: sleepy.penguin

https://github.com/rubinius/rubinius/issues/2771
---
 ext/sleepy_penguin/util.c | 8 ++++++++
 1 file changed, 8 insertions(+)

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);
-- 
1.8.5.rc2.1.g2f4e96a



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-21 18:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-21 18:48 [sleepy.penguin] [PATCH] work around lack of rb_io_get_io in Rubinius Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/sleepy_penguin.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).