Skip to content

Commit 1830784

Browse files
committed
Consensus: Fix bug when compiler do not support __builtin_clz*
#ifdef is not correct since defination is defined to 0 or 1. Should change to #if
1 parent 9e2ed25 commit 1830784

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crypto/common.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,12 @@ void static inline WriteBE64(unsigned char* ptr, uint64_t x)
8282
/** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */
8383
uint64_t static inline CountBits(uint64_t x)
8484
{
85-
#ifdef HAVE_DECL___BUILTIN_CLZL
85+
#if HAVE_DECL___BUILTIN_CLZL
8686
if (sizeof(unsigned long) >= sizeof(uint64_t)) {
8787
return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0;
8888
}
8989
#endif
90-
#ifdef HAVE_DECL___BUILTIN_CLZLL
90+
#if HAVE_DECL___BUILTIN_CLZLL
9191
if (sizeof(unsigned long long) >= sizeof(uint64_t)) {
9292
return x ? 8 * sizeof(unsigned long long) - __builtin_clzll(x) : 0;
9393
}

0 commit comments

Comments
 (0)