diff options
author | Karl Williamson <khw@cpan.org> | 2017-12-07 18:09:15 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2017-12-07 22:12:26 -0700 |
commit | de9e2639368b39c98a5f229c0c71db2c9bf32c7f (patch) | |
tree | db17ecc9df1bc7502b094d29b28c821de41b4454 /handy.h | |
parent | 74b807c7d538d0f04cc376335c9d4c3aafbb13ea (diff) | |
download | perl-de9e2639368b39c98a5f229c0c71db2c9bf32c7f.tar.gz |
handy.h: Fix definition of WIDEST_UTYPE for non-core
Because HAS_QUAD is not defined outside the perl core, this macro was
not getting defined properly for 64-bit systems. This means, for
example, that someone using this to cast could end up with the wrong
answer. For example isASCII(2**32) would yield true, because the high
bit would get dropped by the cast, making the value appear to be zero.
This unfortunately creates a warning message in the compile that
WIDEST_UTYPE is redefined, as the definition of that is defective in
PPPort. It should only define it if it wasn't previously defined, and
it is wrongly using the 32 bit version. This is added impetus to get
PPPort fixed
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -1088,11 +1088,9 @@ patched there. The file as of this writing is cpan/Devel-PPPort/parts/inc/misc */ -/* Specify the widest unsigned type on the platform. Use U64TYPE because U64 - * is known only in the perl core, and this macro can be called from outside - * that */ -#ifdef HAS_QUAD -# define WIDEST_UTYPE U64TYPE +/* Specify the widest unsigned type on the platform. */ +#ifdef QUADKIND +# define WIDEST_UTYPE U64 #else # define WIDEST_UTYPE U32 #endif |