diff options
-rw-r--r-- | ext/tk/tkutil/extconf.rb | 2 | ||||
-rw-r--r-- | ext/tk/tkutil/tkutil.c | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/ext/tk/tkutil/extconf.rb b/ext/tk/tkutil/extconf.rb index 9ffde75657..6a64e6b92d 100644 --- a/ext/tk/tkutil/extconf.rb +++ b/ext/tk/tkutil/extconf.rb @@ -4,7 +4,7 @@ begin have_func("rb_obj_instance_exec", "ruby.h") have_func("rb_obj_untrust", "ruby.h") have_func("rb_obj_taint", "ruby.h") - have_func("rb_sym_to_s", "ruby.h") + have_func("rb_sym2str", "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 26ae957bf2..f3450b12d8 100644 --- a/ext/tk/tkutil/tkutil.c +++ b/ext/tk/tkutil/tkutil.c @@ -42,6 +42,10 @@ static int rb_thread_critical; /* dummy */ extern char *strndup(const char* _ptr, size_t _len); #endif +#ifndef HAVE_RB_SYM2STR +# define rb_sym2str(obj) rb_id2str(SYM2ID(obj)) +#endif + static VALUE cMethod; static VALUE cTclTkLib; @@ -839,11 +843,7 @@ get_eval_string_core(obj, enc_flag, self) return fromDefaultEnc_toUTF8(rb_sym2str(obj), self); } } else { -#ifdef HAVE_RB_SYM_TO_S - return rb_sym_to_s(obj); -#else return rb_sym2str(obj); -#endif } case T_HASH: |