Skip to content

Commit

Permalink
Add implementation of count_leading_zeros<LL>
Browse files Browse the repository at this point in the history
Clang seems to think that timestamp_t^timestamp_t is a long-long (rather
than be either unsigned or a plain long like gcc does).  This patch adds
an implementation for <long long> (modeled off of <long>) that properly
compiles.

Signed-off-by: Erich Keane <[email protected]>
Message-Id: <[email protected]>
  • Loading branch information
erichkeane authored and avikivity committed Jan 28, 2016
1 parent 9a5a960 commit fbd9b30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/bitset-iter.hh
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ inline size_t count_leading_zeros<long>(long value)
return __builtin_clzl((unsigned long)value) - 1;
}

template<>
inline size_t count_leading_zeros<long long>(long long value)
{
return __builtin_clzll((unsigned long long)value) - 1;
}

template<>
inline
size_t count_trailing_zeros<unsigned long>(unsigned long value)
Expand Down

0 comments on commit fbd9b30

Please sign in to comment.