mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Make sure TracyCountBits() always returns uint64_t.
This commit is contained in:
parent
65ea33a60f
commit
68f476834f
@ -7,9 +7,12 @@
|
||||
# include <intrin.h>
|
||||
# define TracyCountBits __popcnt64
|
||||
#elif defined __GNUC__ || defined __clang__
|
||||
# define TracyCountBits __builtin_popcountll
|
||||
static inline uint64_t TracyCountBits( uint64_t i )
|
||||
{
|
||||
return uint64_t( __builtin_popcountll( i ) );
|
||||
}
|
||||
#else
|
||||
static inline int TracyCountBits( uint64_t i )
|
||||
static inline uint64_t TracyCountBits( uint64_t i )
|
||||
{
|
||||
i = i - ( (i >> 1) & 0x5555555555555555 );
|
||||
i = ( i & 0x3333333333333333 ) + ( (i >> 2) & 0x3333333333333333 );
|
||||
|
Loading…
Reference in New Issue
Block a user