diff --git a/Internal.h b/Internal.h index 3283b22..bf36daa 100644 --- a/Internal.h +++ b/Internal.h @@ -2,6 +2,7 @@ #include "ConflictSet.h" +#include #include #include #include @@ -83,7 +84,7 @@ constexpr inline int align_up(uint32_t unaligned, uint32_t align) { /// Returns the smallest power of two >= x [[maybe_unused]] constexpr inline uint32_t nextPowerOfTwo(uint32_t x) { - return x <= 1 ? 1 : 1 << (32 - __builtin_clz(x - 1)); + return x <= 1 ? 1 : 1 << (32 - std::countl_zero(x - 1)); } struct Arena::ArenaImpl { @@ -277,7 +278,7 @@ inline uint32_t Arbitrary::bounded(uint32_t s) { if (s == 1) { return 0; } - switch (32 - __builtin_clz(s - 1)) { + switch (32 - std::countl_zero(s - 1)) { case 1: case 2: case 3: