[前][次][番号順一覧][スレッド一覧]

ruby-changes:38229

From: nobu <ko1@a...>
Date: Tue, 14 Apr 2015 12:36:31 +0900 (JST)
Subject: [ruby-changes:38229] nobu:r50310 (trunk): tkutil.c: fallback rb_id2str

nobu	2015-04-14 12:36:19 +0900 (Tue, 14 Apr 2015)

  New Revision: 50310

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50310

  Log:
    tkutil.c: fallback rb_id2str
    
    * ext/tk/tkutil/tkutil.c (rb_id2str): add fallback definition.

  Modified files:
    trunk/ext/tk/tkutil/extconf.rb
    trunk/ext/tk/tkutil/tkutil.c
Index: ext/tk/tkutil/extconf.rb
===================================================================
--- ext/tk/tkutil/extconf.rb	(revision 50309)
+++ ext/tk/tkutil/extconf.rb	(revision 50310)
@@ -5,6 +5,7 @@ begin https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/extconf.rb#L5
   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')
Index: ext/tk/tkutil/tkutil.c
===================================================================
--- ext/tk/tkutil/tkutil.c	(revision 50309)
+++ ext/tk/tkutil/tkutil.c	(revision 50310)
@@ -46,6 +46,10 @@ extern char *strndup(const char* _ptr, s https://github.com/ruby/ruby/blob/trunk/ext/tk/tkutil/tkutil.c#L46
 # 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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]