BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface software
platform_independence.hpp
Go to the documentation of this file.
1 #ifdef _MSC_VER
2 #include <intrin.h>
3  #ifdef _M_X64
4  #define __builtin_popcountll __popcnt64
5  #else
6  inline int __builtin_popcountll(unsigned __int64 value)
7  {
8  unsigned int lowBits = (unsigned int)value;
9  int count = __popcnt(lowBits);
10  unsigned int highBits = (unsigned int)(value >> 32);
11  count += __popcnt(highBits);
12  return count;
13  }
14  #endif
15 #endif