From: Eric Wong on
Xeno Campanoli <xeno.campanoli(a)gmail.com> wrote:
> Okay, I found the sequence in the README. Sorry. It still fails, and I
> tried putting the preprocessor stuff you recommend both before and after
> the two initial includes in the file, with these results:
>
> -mtune=generic -Wall -fno-strict-aliasing -fPIC -c misc.c
> misc.c: In function 'rb_ldap_get_apiinfo':
> misc.c:63: warning: implicit declaration of function 'RARRAY_LEN'
> misc.c:67: warning: implicit declaration of function 'RARRAY_PTR'
> misc.c:67: error: subscripted value is neither array nor pointer
> make: *** [misc.o] Error 1
> #
> ---snip---

OK, we got farther since it's no longer barfing on RSTRING_*
but RARRAY_* instead.

> I don't see any other of these R.*_ preprocessor functions (well, there
> is an RB.*something, but hopefully) so that maybe if you can give me an
> appropriate #define for that one it might work...????

So just add these now, and hopefully there aren't more
incompatibilities....

#ifndef RARRAY_PTR
# define RARRAY_PTR(s) (RARRAY(s)->ptr)
#endif
#ifndef RARRAY_LEN
# define RARRAY_LEN(s) (RARRAY(s)->len)
#endif

If upgrading your version of Ruby isn't an option for you, I suggest
grabbing the latest 1.8.7 source and taking any other macros you might
need from the headers.

--
Eric Wong

From: Xeno Campanoli on
Eric Wong wrote:
> Xeno Campanoli <xeno.campanoli(a)gmail.com> wrote:
>> Okay, I found the sequence in the README. Sorry. It still fails, and I
>> tried putting the preprocessor stuff you recommend both before and after
>> the two initial includes in the file, with these results:
>>
>> -mtune=generic -Wall -fno-strict-aliasing -fPIC -c misc.c
>> misc.c: In function 'rb_ldap_get_apiinfo':
>> misc.c:63: warning: implicit declaration of function 'RARRAY_LEN'
>> misc.c:67: warning: implicit declaration of function 'RARRAY_PTR'
>> misc.c:67: error: subscripted value is neither array nor pointer
>> make: *** [misc.o] Error 1
>> #
>> ---snip---
>
> OK, we got farther since it's no longer barfing on RSTRING_*
> but RARRAY_* instead.
>
>> I don't see any other of these R.*_ preprocessor functions (well, there
>> is an RB.*something, but hopefully) so that maybe if you can give me an
>> appropriate #define for that one it might work...????
>
> So just add these now, and hopefully there aren't more
> incompatibilities....
>
> #ifndef RARRAY_PTR
> # define RARRAY_PTR(s) (RARRAY(s)->ptr)
> #endif
> #ifndef RARRAY_LEN
> # define RARRAY_LEN(s) (RARRAY(s)->len)
> #endif
Okay, I put all this stuff into rbldap.h instead of misc.c, as I got the same
problem for RARRAY stuff from conn.c. Then I got a compile. I haven't checked
to see if it works yet, and I'll post further if it does not, but this is a good
step to reply with thanks.

>
> If upgrading your version of Ruby isn't an option for you, I suggest
> grabbing the latest 1.8.7 source and taking any other macros you might
> need from the headers.
>
That is what I will prefer for my stuff, but the whole point of this exercise is
to get a fairly standard deliverable on CentOS, so I'll likely need to make a
local gem for my deliverable. I will look and see about a 1.9 install, but I'm
afraid for these purposes the rbldap.h hack will be more appropriate.

Thanks. I will reply with a note on whether this really works.

Sincerely, Xeno.

--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member

From: Xeno Campanoli on
Eric Wong wrote:

Looks like that gets me to my starting point on Ubuntu Server. I may have other
questions, but you got me started Eric. Thank you.

xc

> Xeno Campanoli <xeno.campanoli(a)gmail.com> wrote:
>> Okay, I found the sequence in the README. Sorry. It still fails, and I
>> tried putting the preprocessor stuff you recommend both before and after
>> the two initial includes in the file, with these results:
>>
>> -mtune=generic -Wall -fno-strict-aliasing -fPIC -c misc.c
>> misc.c: In function 'rb_ldap_get_apiinfo':
>> misc.c:63: warning: implicit declaration of function 'RARRAY_LEN'
>> misc.c:67: warning: implicit declaration of function 'RARRAY_PTR'
>> misc.c:67: error: subscripted value is neither array nor pointer
>> make: *** [misc.o] Error 1
>> #
>> ---snip---
>
> OK, we got farther since it's no longer barfing on RSTRING_*
> but RARRAY_* instead.
>
>> I don't see any other of these R.*_ preprocessor functions (well, there
>> is an RB.*something, but hopefully) so that maybe if you can give me an
>> appropriate #define for that one it might work...????
>
> So just add these now, and hopefully there aren't more
> incompatibilities....
>
> #ifndef RARRAY_PTR
> # define RARRAY_PTR(s) (RARRAY(s)->ptr)
> #endif
> #ifndef RARRAY_LEN
> # define RARRAY_LEN(s) (RARRAY(s)->len)
> #endif
>
> If upgrading your version of Ruby isn't an option for you, I suggest
> grabbing the latest 1.8.7 source and taking any other macros you might
> need from the headers.
>


--
"It's the preponderance, stupid!" - Professor Stephen Schneider, IPCC member