[MacRuby] #282: <MacRuby/MacRuby.h> cannot be included in Objective-C++ source files
#282: <MacRuby/MacRuby.h> cannot be included in Objective-C++ source files ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… 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/>
#282: <MacRuby/MacRuby.h> cannot be included in Objective-C++ source files ---------------------------+------------------------------------------------ Reporter: easco@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: minor | Milestone: MacRuby 0.5 Component: MacRuby | Resolution: fixed Keywords: | ---------------------------+------------------------------------------------ Changes (by lsansonetti@…): * status: new => closed * resolution: => fixed * milestone: => MacRuby 0.5 Comment: This should be fixed in trunk, I remember fixing these headers since they are included in core .cpp files. -- Ticket URL: <http://www.macruby.org/trac/ticket/282#comment:1> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby