diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-12 09:27:43 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-12 09:27:43 +0000 |
| commit | 004f01e7375ad0a654f8193099e7e61a2c589c84 (patch) | |
| tree | e145d77965670f2e7f568e694b7b17b8a0ecce93 | |
| parent | 1a5a1476b5c2028123128bc8896daadd56275e1c (diff) | |
| download | ruby-004f01e7375ad0a654f8193099e7e61a2c589c84.tar.gz ruby-004f01e7375ad0a654f8193099e7e61a2c589c84.tar.xz ruby-004f01e7375ad0a654f8193099e7e61a2c589c84.zip | |
* eval_method.c (rb_define_alloc_func, rb_undef_alloc_func): should
define/undef on a signleton class. [ruby-core:09959]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | eval_method.c | 6 |
2 files changed, 10 insertions, 3 deletions
@@ -1,3 +1,10 @@ +Sat Jan 12 18:27:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@ruby-lang.org> * ext/nkf/nkf.c: rdoc update. diff --git a/eval_method.c b/eval_method.c index 34a65b7fa..ff26ebe08 100644 --- a/eval_method.c +++ b/eval_method.c @@ -180,10 +180,10 @@ rb_add_method(VALUE klass, ID mid, NODE * node, int noex) } 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 @@ void 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 |
