in reply to Best way to check for 64-bit support

There are many ways to look at the size of integers :)

If you *also* want to support 64bit ints on a 32bit conf, you could consider if Math::BigInt could help

You did not state if your realm is pure-perl or also XS. If you know how to work around your problem in XS, you could pass the big ints as string and work from there.

In the pure-perl world, an "integer" is an IV (Integer Value). Its size in bytes is shown in $Config{ivsize}. Internally an IV does not need to be mapped to an int, but it might be a long or even long long.

$ perl -V:.*64bit.* use64bitall='define'; use64bitint='define'; $ perl -V:.*size.* charsize='1'; d_chsize='undef'; d_malloc_good_size='undef'; d_malloc_size='undef'; doublesize='8'; fpossize='16'; gidsize='4'; i16size='2'; i32size='4'; i64size='8'; i8size='1'; intsize='4'; ivsize='8'; longdblsize='16'; longlongsize='8'; longsize='8'; lseeksize='8'; nvsize='16'; ptrsize='8'; shortsize='2'; sig_size='68'; sizesize='8'; sizetype='size_t'; socksizetype='socklen_t'; ssizetype='ssize_t'; st_ino_size='8'; u16size='2'; u32size='4'; u64size='8'; u8size='1'; uidsize='4'; uvsize='8';

Enjoy, Have FUN! H.Merijn

Replies are listed 'Best First'.
Re^2: Best way to check for 64-bit support
by eyepopslikeamosquito (Archbishop) on Sep 08, 2021 at 13:15 UTC

    Internally an IV does not need to be mapped to an int, but it might be a long or even long long

    Indeed. I'd go further and speculate that an IV is mapped to a long or long long on almost all 64-bit platforms because the two overwhelmingly dominant 64-bit programming models (LP64 and LLP64) both use 32-bit ints. That is, I'd expect to see:

    intsize='4'; ivsize='8';
    on just about every 64-bit Perl.

    I remember this from a fascinating thread a few months back, where syphilis noted he's "never struck a perl where $Config{intsize} != 4".