Re: Conditional compile if 64-bit cpu, in .xs ?



On 2006-08-28, Ilya Zakharevich <nospam-abuse@xxxxxxxxx> wrote:
Peter Billam wrote:
Greetings xs folk. Suppose I have a bug-fix in a .xs file looking like
v0 &= 0xffffffff;
which is only necessary on 64-bit architectures... For speed reasons
I'd like to not include that line on 32-bit machines. Is there some
convenient
#ifdef 64whatever
v0 &= 0xffffffff;
#endif
defined by the xs that I can use ?

Why? Just add -DMY_64bit_FIX_NEEDED in Makefile.PL

OK, I think I get it...
You mean in Makefile.PL have, if ($Config{use64bitint}) then
DEFINE => '-DMY_64bit_FIX_NEEDED',
and then put
#ifdef MY_64bit_FIX_NEEDED
v0 &= 0xffffffff;
#endif
in the .xs ?

after inspecting %Config *for the conditions you need*,
not some "random thing" being 64-bit...

Presumably in this case I'd be looking for $Config{use64bitint} ?

Thanks for your help, Peter

--
AUS/TAS/DPIW/CIT/Servers hbt/lnd/l8 6233 3061 http://www.pjb.com.au
Pasaré, pasarémos dice el agua y canta la verdad contra la piedra
-- Pablo Neruda
.



Relevant Pages