ruby-changes:3526
From: ko1@a...
Date: Sun, 13 Jan 2008 15:38:35 +0900 (JST)
Subject: [ruby-changes:3526] nobu - Ruby:r15004 (trunk): * eval_method.c (rb_define_alloc_func, rb_undef_alloc_func): should
nobu 2008-01-12 18:27:43 +0900 (Sat, 12 Jan 2008) New Revision: 15004 Modified files: trunk/ChangeLog trunk/eval_method.c Log: * eval_method.c (rb_define_alloc_func, rb_undef_alloc_func): should define/undef on a signleton class. [ruby-core:09959] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/eval_method.c?r1=15004&r2=15003&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15004&r2=15003&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15003) +++ ChangeLog (revision 15004) @@ -1,3 +1,10 @@ +Sat Jan 12 18:27:41 2008 Nobuyoshi Nakada <nobu@r...> + + * eval.c (rb_define_alloc_func, rb_undef_alloc_func): should + define/undef on a signleton class. [ruby-core:09959] + +9959] + Sat Jan 12 12:44:36 2008 NARUSE, Yui <naruse@r...> * ext/nkf/nkf.c: rdoc update. Index: eval_method.c =================================================================== --- eval_method.c (revision 15003) +++ eval_method.c (revision 15004) @@ -180,10 +180,10 @@ } void -rb_define_alloc_func(VALUE klass, VALUE (*func) _((VALUE))) +rb_define_alloc_func(VALUE klass, VALUE (*func)(VALUE)) { Check_Type(klass, T_CLASS); - rb_add_method(CLASS_OF(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0), + rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, NEW_CFUNC(func, 0), NOEX_PRIVATE); } @@ -191,7 +191,7 @@ rb_undef_alloc_func(VALUE klass) { Check_Type(klass, T_CLASS); - rb_add_method(CLASS_OF(klass), ID_ALLOCATOR, 0, NOEX_UNDEF); + rb_add_method(rb_singleton_class(klass), ID_ALLOCATOR, 0, NOEX_UNDEF); } rb_alloc_func_t -- ML: ruby-changes@q... Info: