Skip to content

Commit cbc1fcf

Browse files
committed
Merge #12573: Fix compilation when compiler do not support __builtin_clz*
1830784 Consensus: Fix bug when compiler do not support __builtin_clz* (532479301) Pull request description: #ifdef is not correct since defination is defined to 0 or 1. Should change to #if Tree-SHA512: ba13a591d28f4d7d6ebaab081be4304c43766a611226f8d2994c8db415dfcf318e82217d26a8c4af290760c68eded9503b39535b0e6e079ded912e6a8fca5b36
2 parents 9d49dcf + 1830784 commit cbc1fcf

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)