Bug #4803

RCLASS_SUPER won't compile for C extensions as of revision 31627

Added by Daniel Azuma over 4 years ago. Updated about 4 years ago.

[ruby-core:36565]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:- Backport:

Description

The RCLASS_SUPER macro (defined in ruby.h) no longer compiles for C extensions because the required rb_classext_t type has been made opaque as of svn revision 31627. This is breaking certain gems that rely on RCLASS_SUPER to hack the class tree, such as blockenspiel and mixology.

Associated revisions

Revision 32162
Added by Nobuyoshi Nakada about 4 years ago

  • include/ruby/backward/classext.h: for evil gems. fixed #4803

Revision 32162
Added by Nobuyoshi Nakada about 4 years ago

  • include/ruby/backward/classext.h: for evil gems. fixed #4803

History

#1 Updated by Daniel Azuma over 4 years ago

Can anyone explain to me the rationale behind moving the rb_classext_t definition into internal.h, and what I should do in 1.9.3 to access the functionality of RCLASS_SUPER? I need to access and set the direct superclass, even if it's a T_ICLASS, so calling rb_class_superclass() is not sufficient. Thanks!

#2 Updated by Yukihiro Matsumoto over 4 years ago

  • ruby -v changed from ruby 1.9.3dev (2011-05-30 trunk 31805) [x86_64-darwin10.7.4] to -

Hi,

In message "Re: [Ruby 1.9 - Bug #4803] RCLASS_SUPER won't compile for C extensions as of revision 31627"
on Mon, 30 May 2011 14:53:13 +0900, Daniel Azuma dazuma@gmail.com writes:
|
|Can anyone explain to me the rationale behind moving the rb_classext_t definition into internal.h, and what I should do in 1.9.3 to access the functionality of RCLASS_SUPER? I need to access and set the direct superclass, even if it's a T_ICLASS, so calling rb_class_superclass() is not sufficient. Thanks!

I think Nobu considered rb_classext_t should not be disclosed to
extensions, but since some extensions already use it, it might be
better to make it public anyway.

                        matz.

#3 Updated by Yukihiro Matsumoto over 4 years ago

  • Status changed from Open to Assigned
  • Assignee set to Nobuyoshi Nakada

#4 Updated by Roger Pack over 4 years ago

just ran into this, as well

https://gist.github.com/1006162

If there's a work around do let us know :)

-roger-

#5 Updated by Nobuyoshi Nakada about 4 years ago

Hi,

At Sat, 4 Jun 2011 01:33:38 +0900,
Roger Pack wrote in :

just ran into this, as well

https://gist.github.com/1006162

If there's a work around do let us know :)

rb_class_superclass() since 1.4.0.

--
Nobu Nakada

#6 Updated by Nobuyoshi Nakada about 4 years ago

Hi,

At Mon, 6 Jun 2011 23:47:57 +0900,
Roger Pack wrote in :

rb_class_superclass() since 1.4.0.

Appears it has become public with 1.9.3?

Sure, it had been static, sorry.

So you can use it if available, RCLASS_SUPER() if defined, or
the member directly.

--
Nobu Nakada

#7 Updated by Nobuyoshi Nakada about 4 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r32162.
Daniel, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • include/ruby/backward/classext.h: for evil gems. fixed #4803

Also available in: Atom PDF