diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2020-07-20 11:36:51 +0100 |
---|---|---|
committer | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2020-07-20 13:25:46 +0100 |
commit | fae1e72be2049299c589fc851d41287ac5a7ea13 (patch) | |
tree | 88563b6adfa64b365655ba24302495b2014cd5d3 /handy.h | |
parent | 74480d1ecedfd7ff497b70de9e5b07cd4ae997c0 (diff) | |
download | perl-fae1e72be2049299c589fc851d41287ac5a7ea13.tar.gz |
Use UINTMAX_C() in nBIT_MASK() definition
We already have a macro for constants of the largest available type,
use that instead of HAS_LONG_LONG, which is (erroneously?) not defined
under MSVC.
Diffstat (limited to 'handy.h')
-rw-r--r-- | handy.h | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -273,11 +273,7 @@ typedef U64TYPE U64; #endif /* Returns a mask with the lowest n bits set */ -#ifdef HAS_LONG_LONG -# define nBIT_MASK(n) ((1ULL << (n)) - 1) -#else -# define nBIT_MASK(n) ((1UL << (n)) - 1) -#endif +#define nBIT_MASK(n) ((UINTMAX_C(1) << (n)) - 1) /* The largest unsigned number that will fit into n bits */ #define nBIT_UMAX(n) nBIT_MASK(n) |