mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-09-27 22:45:27 +00:00
Replace MSVC implementation of __builtin_popcount with C code
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user