summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;