In my environment (Tru64 on Compaq Alpha) I32 is an int and IV is a long.
This means that the following example (from 'Adbvanced Perl' fails:
TYPEMAP
Car * CAR_OBJ
OUTPUT
CAR_OBJ
sv_setref_iv($arg, "Car", (I32) $var);
INPUT
CAR_OBJ
$var = (Car *)SvIV((SV*)SvRV($arg));
The problem is that the cast to I32 truncates the 64 bit pointer to 32 bits.
It also contradicts the statement (also in 'Advanced Perl') that:
"All the tables in this chapter make use of two important typedefs, I32 and
U32, which represent signed and unsigned integral quantities that are at
least 32 bits wide and big enough to hold a pointer (it will be 64 bits on a
64-bit machine)."
perlguts, on the other hand, seems to imply that an IV is quaranteed to be
big enough to hold a pointer, but the only qurantee about I32 is that it is
at least 32 bits.
So, what's the deal? Should I32 be big enough to hold a pointer or not?
Thanks in advance.
-Ray Hookway