summaryrefslogtreecommitdiff
path: root/handy.h
diff options
context:
space:
mode:
authorDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-07-20 11:36:51 +0100
committerDagfinn Ilmari Mannsåker <ilmari@ilmari.org>2020-07-20 13:25:46 +0100
commitfae1e72be2049299c589fc851d41287ac5a7ea13 (patch)
tree88563b6adfa64b365655ba24302495b2014cd5d3 /handy.h
parent74480d1ecedfd7ff497b70de9e5b07cd4ae997c0 (diff)
downloadperl-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.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/handy.h b/handy.h
index a2da312351..7527461d81 100644
--- a/handy.h
+++ b/handy.h
@@ -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)