add win32 (msvc) support
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <string.h>
|
||||
#include <blue/object/bitmap.h>
|
||||
#include <blue/core/bitop.h>
|
||||
|
||||
void b_bitmap_zero(b_bitmap_word *map, unsigned long nbits)
|
||||
{
|
||||
@@ -38,7 +39,6 @@ bool b_bitmap_check(const b_bitmap_word *map, unsigned long bit)
|
||||
unsigned long mask = 1ul << offset;
|
||||
|
||||
return (map[index] & mask) != 0;
|
||||
|
||||
}
|
||||
|
||||
unsigned int b_bitmap_count_set(const b_bitmap_word *map, unsigned long nbits)
|
||||
@@ -47,7 +47,7 @@ unsigned int b_bitmap_count_set(const b_bitmap_word *map, unsigned long nbits)
|
||||
unsigned int set_bits = 0;
|
||||
|
||||
for (unsigned long i = 0; i < words; i++) {
|
||||
set_bits += __builtin_popcountl(map[i]);
|
||||
set_bits += b_popcountl(map[i]);
|
||||
}
|
||||
|
||||
if (set_bits > nbits) {
|
||||
@@ -63,7 +63,7 @@ unsigned int b_bitmap_count_clear(const b_bitmap_word *map, unsigned long nbits)
|
||||
unsigned int clear_bits = 0;
|
||||
|
||||
for (unsigned long i = 0; i < words; i++) {
|
||||
clear_bits += __builtin_popcountl(~map[i]);
|
||||
clear_bits += b_popcountl(~map[i]);
|
||||
}
|
||||
|
||||
if (clear_bits > nbits) {
|
||||
@@ -91,7 +91,7 @@ unsigned int b_bitmap_highest_set(const b_bitmap_word *map, unsigned long nbits)
|
||||
return B_BITMAP_NPOS;
|
||||
}
|
||||
|
||||
return bit_index + (Z__B_BITS_PER_WORD - __builtin_ctzl(last_word) - 1);
|
||||
return bit_index + (Z__B_BITS_PER_WORD - b_ctzl(last_word) - 1);
|
||||
}
|
||||
|
||||
unsigned int b_bitmap_highest_clear(const b_bitmap_word *map, unsigned long nbits)
|
||||
@@ -115,7 +115,7 @@ unsigned int b_bitmap_highest_clear(const b_bitmap_word *map, unsigned long nbit
|
||||
return bit_index + Z__B_BITS_PER_WORD - 1;
|
||||
}
|
||||
|
||||
return bit_index + (Z__B_BITS_PER_WORD - __builtin_ctzl(~last_word)) - 1;
|
||||
return bit_index + (Z__B_BITS_PER_WORD - b_ctzl(~last_word)) - 1;
|
||||
}
|
||||
|
||||
unsigned int b_bitmap_lowest_set(const b_bitmap_word *map, unsigned long nbits)
|
||||
@@ -137,7 +137,7 @@ unsigned int b_bitmap_lowest_set(const b_bitmap_word *map, unsigned long nbits)
|
||||
return B_BITMAP_NPOS;
|
||||
}
|
||||
|
||||
return bit_index + __builtin_clzl(last_word);
|
||||
return bit_index + b_clzl(last_word);
|
||||
}
|
||||
|
||||
unsigned int b_bitmap_lowest_clear(const b_bitmap_word *map, unsigned long nbits)
|
||||
@@ -163,5 +163,5 @@ unsigned int b_bitmap_lowest_clear(const b_bitmap_word *map, unsigned long nbits
|
||||
return B_BITMAP_NPOS;
|
||||
}
|
||||
|
||||
return bit_index + __builtin_clzl(~last_word);
|
||||
return bit_index + b_clzl(~last_word);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user