[Win32utils-devel] 1.9.x compatibility for win32-api

Berger, Daniel Daniel.Berger at qwest.com
Wed Feb 18 14:17:32 EST 2009


 

> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org 
> [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of 
> Luis Lavena
> Sent: Wednesday, February 18, 2009 11:42 AM
> To: Development and ideas for win32utils projects
> Subject: Re: [Win32utils-devel] 1.9.x compatibility for win32-api
> 
> On Wed, Feb 18, 2009 at 4:04 PM, James Tucker 
> <jftucker at gmail.com> wrote:
> >
> > On 18 Feb 2009, at 16:55, Luis Lavena wrote:
> >
> >> On Wed, Feb 18, 2009 at 2:31 PM, Berger, Daniel 
> >> <Daniel.Berger at qwest.com>
> >> wrote:
> >>>
> >>> It seems 1.9 doesn't allow stuff like RSTRING(ptr)->len; you must 
> >>> instead use wrapper macros like RSTRING_LEN(ptr). I'm not 
> really sure why.
> >
> > To allow restructuring of the value at the other end of ptr?
> >
> >> This is the average working solution to it:
> >>
> >> 
> http://github.com/fauna/mongrel/blob/HEAD/ext/http11/http11.c#L11-16
> >
> > Less needed here, so went for simpler:
> >
> > 
> http://github.com/eventmachine/eventmachine/commit/a9cee3895048ffbd2a5
> > e1da804b319d99ff68443
> >
> 
> Hmn, that is lot of noise and conditionals through your code...
> 
> What is wrong with defining those when don't exist and update 
> your code for it?

Yeah, I think I prefer the http11.c approach.

I'm a little stuck at the moment, as it appears 1.9.x has separate macros for RARRAY(ptr) vs RARRAY(ptr)->[index]. Anyone happen to know what it is?

Anyway, this is what I've got so far. If anyone can fill in the "???" for me that would be swell.

// Ruby 1.9.x
#ifndef RSTRING_PTR
#define RSTRING_PTR(s) (RSTRING(s)->ptr)
#endif
#ifndef RSTRING_LEN
#define RSTRING_LEN(s) (RSTRING(s)->len)
#endif

#ifndef RARRAY_PTR
#define RARRAY_PTR(a) (RARRAY(a)->ptr)
#define RARRAY_?????? (RARRAY(a)->ptr[i])
#endif
#ifndef RARRAY_LEN
#define RARRAY_LEN(a) (RARRAY(a)->len)
#endif

Regards,

Dan


More information about the win32utils-devel mailing list