Nicholas Clark ([EMAIL PROTECTED]) writes:
> I don't see anything wrong with
> 
>    STRLEN perl_len;
>    SvPV(sv, perl_len);
> 
> The macro SvPV will always assign the length to perl_len.
> (I'm ignoring the return value from it because you didn't seem to need the
> pointer)

How embarrassing! My lame excuse will have to be something about too many
trees hiding the woods for me.

Yes, I've seen that second parameter, and I always send in PL_na as I've
been told do. Never occurred to me to check out what it's good for.
 
> To be portable you need to ensure that the type of the second argument
> to SvPV is STRLEN, else your code will have problems on 64 bit
> platforms. The macro passes a pointer to the variable into a function,
> and if the variable is 32 bits when 64 is expected, or vice versa,
> you'll get corrupt values. 

Thanks for pointing it out. However, I believe my biggest obstacle of
getting my code to compile and run on a 64-bit machine is the lack of the
same...

Thanks to both Nicholas and Gisle for answering my question. 

-- 
Erland Sommarskog, Stockholm, [EMAIL PROTECTED]

Reply via email to