From 659f14b254a990cc19667b804f7d1627a927a4f7 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 14 Apr 2015 03:36:19 +0000 Subject: 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 --- ext/tk/tkutil/extconf.rb | 1 + ext/tk/tkutil/tkutil.c | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'ext') 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; -- cgit v1.2.3