summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-15 00:02:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-15 00:02:59 +0000
commit9816f87815d27405e1f6c53ed20ad51bdca570ce (patch)
treefae7cd41051cfb7c9f83635aee8a48921857fe04
parentcc91082af8279f878d03f722419b5862b2c5c95e (diff)
io/console: rb_sym2str
* ext/io/console/console.c (rb_sym2str): fallback definition for older ruby. [ruby-core:74953] [Bug #12284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--ext/io/console/console.c4
-rw-r--r--ext/io/console/extconf.rb1
3 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 70db0a2..ecbb49e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 15 09:02:58 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/io/console/console.c (rb_sym2str): fallback definition for
+ older ruby. [ruby-core:74953] [Bug #12284]
+
Thu Apr 14 21:46:36 2016 Tanaka Akira <akr@fsij.org>
* array.c (rb_ary_sum): Support the optional argument, init, and
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index ea5ff12..ec7ecda 100644
--- a/ext/io/console/console.c
+++ b/ext/io/console/console.c
@@ -103,6 +103,10 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
}
#endif
+#ifndef HAVE_RB_SYM2STR
+# define rb_sym2str(sym) rb_id2str(SYM2ID(sym))
+#endif
+
typedef struct {
int vmin;
int vtime;
diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb
index 454a3a7..be536df 100644
--- a/ext/io/console/extconf.rb
+++ b/ext/io/console/extconf.rb
@@ -18,6 +18,7 @@ end
if ok
have_header("sys/ioctl.h") if hdr
have_func("rb_funcallv")
+ have_func("rb_sym2str")
# rb_check_hash_type: 1.9.3
# rb_io_get_write_io: 1.9.1
# rb_cloexec_open: 2.0.0