#282: <MacRuby/MacRuby.h> cannot be included in Objective-C++ source files
---------------------------+------------------------------------------------
 Reporter:  ea...@…        |       Owner:  lsansone...@…        
     Type:  defect         |      Status:  new                  
 Priority:  minor          |   Milestone:                       
Component:  MacRuby        |    Keywords:                       
---------------------------+------------------------------------------------
 The definitions in ruby/ruby.h contain code that will not compile in an
 Objective-C++ source file.  In particular, RCLASS_VERSION, RCLASS_META and
 similar definitions like it use a (void *) pointer as the base for some
 pointer arithmetic. For example:

 #  define RCLASS_VERSION(m) (*(long *)((void *)m + (sizeof(void *) * 3)))

 The problem is the (void *) typecast before "m".  C++ does not allow
 pointer arithmetic based off of a (void *) pointer.

 I was able to work around this issue by hacking my local copy of the
 header to use an unsigned char * in the place of the void * value.  I'm
 not sure this is the right solution... but it appears that "m" should be
 typecast to some kind of "pointer to a byte".

-- 
Ticket URL: <http://www.macruby.org/trac/ticket/282>
MacRuby <http://macruby.org/>

_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

Reply via email to