summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-14 03:36:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-04-14 03:36:19 +0000
commit659f14b254a990cc19667b804f7d1627a927a4f7 (patch)
tree23267ccff79facd862de9e4f8620ae2b1dabdbf1 /ext
parent0b2554fe7ecb04001401edf94c2f11a405d54a28 (diff)
tkutil.c: fallback rb_id2str
* ext/tk/tkutil/tkutil.c (rb_id2str): add fallback definition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/tk/tkutil/extconf.rb1
-rw-r--r--ext/tk/tkutil/tkutil.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb
index 6a64e6b92d..20b6f37bce 100644
--- a/ext/tk/tkutil/extconf.rb
+++ b/ext/tk/tkutil/extconf.rb
@@ -5,6 +5,7 @@ begin
have_func("rb_obj_untrust", "ruby.h")
have_func("rb_obj_taint", "ruby.h")
have_func("rb_sym2str", "ruby.h")
+ have_func("rb_id2str", "ruby.h")
have_func("strndup", "string.h")
create_makefile('tkutil')
diff --git a/ext/tk/tkutil/tkutil.c b/ext/tk/tkutil/tkutil.c
index f3450b12d8..be8d7b2364 100644
--- a/ext/tk/tkutil/tkutil.c
+++ b/ext/tk/tkutil/tkutil.c
@@ -46,6 +46,10 @@ extern char *strndup(const char* _ptr, size_t _len);
# define rb_sym2str(obj) rb_id2str(SYM2ID(obj))
#endif
+#ifndef HAVE_RB_ID2STR
+# define rb_id2str(id) rb_str_new2(rb_id2name(id))
+#endif
+
static VALUE cMethod;
static VALUE cTclTkLib;