aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-03-05 18:36:24 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-03-05 18:38:17 +0100
commitcbc1fcf576cdf8e2701f37496a1946bd7870a6e9 (patch)
tree99c1b9839a0069467cb3b35343d6763175a64e11 /src
parent9d49dcf9fab32fe96641d364ee8b2a241020f254 (diff)
parent18307849b405f9e2067eaa8091b105838f413707 (diff)
downloadbitcoin-cbc1fcf576cdf8e2701f37496a1946bd7870a6e9.tar.xz
Merge #12573: Fix compilation when compiler do not support __builtin_clz*
18307849b 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
Diffstat (limited to 'src')
-rw-r--r--src/crypto/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crypto/common.h b/src/crypto/common.h
index 825b430978..6e9d6dc82a 100644
--- a/src/crypto/common.h
+++ b/src/crypto/common.h
@@ -82,12 +82,12 @@ void static inline WriteBE64(unsigned char* ptr, uint64_t x)
/** Return the smallest number n such that (x >> n) == 0 (or 64 if the highest bit in x is set. */
uint64_t static inline CountBits(uint64_t x)
{
-#ifdef HAVE_DECL___BUILTIN_CLZL
+#if HAVE_DECL___BUILTIN_CLZL
if (sizeof(unsigned long) >= sizeof(uint64_t)) {
return x ? 8 * sizeof(unsigned long) - __builtin_clzl(x) : 0;
}
#endif
-#ifdef HAVE_DECL___BUILTIN_CLZLL
+#if HAVE_DECL___BUILTIN_CLZLL
if (sizeof(unsigned long long) >= sizeof(uint64_t)) {
return x ? 8 * sizeof(unsigned long long) - __builtin_clzll(x) : 0;
}