summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-03-03 15:09:49 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-03-03 15:09:49 -0500
commita1646d84127a199fdacb6c5500d96e8829ebe8c1 (patch)
treeeb7d59e50813108105a5bc4539191a3b008a320d /util.c
parentd5488ef5c47878e04045a91d204cf1ccbdd9cd05 (diff)
:shell, bugfixes
Diffstat (limited to 'util.c')
-rw-r--r--util.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/util.c b/util.c
index f14f640..7d0064d 100644
--- a/util.c
+++ b/util.c
@@ -22,13 +22,9 @@ static u8 util_popcount(u64 x) {
static u8 util_count_leading_zeroes32(u32 x) {
if (x == 0) return 32; // GCC's __builtin_clz is undefined for x = 0
-#if __GNUC__
-#if UINT_MAX == 4294967295
+#if __GNUC__ && UINT_MAX == 4294967295
return (u8)__builtin_clz(x);
-#else
- #error "unsigned int isn't 32 bits. this function needs fixing to work on systems like yours."
-#endif
-#elif _WIN32
+#elif _WIN32 && UINT_MAX == 4294967295
return (u8)__lzcnt(x);
#else
u8 count = 0;