Replace MSVC implementation of __builtin_popcount with C code
This commit is contained in:
parent
e1221e22ff
commit
80d53839dd
|
@ -32,10 +32,21 @@
|
|||
|
||||
#define PATH_MAX _MAX_PATH
|
||||
|
||||
#define __builtin_popcount __popcnt
|
||||
|
||||
#define setvbuf msvc_setvbuf
|
||||
|
||||
static inline int __builtin_popcount(unsigned int v)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
while (v)
|
||||
{
|
||||
count += v & 1;
|
||||
v >>= 1;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static inline int msvc_setvbuf(
|
||||
FILE* const public_stream,
|
||||
char* const buffer,
|
||||
|
|
Loading…
Reference in New Issue