#include "firm_config.h"
#include "bitfiddle.h"
+#ifdef _WIN32
+#include <malloc.h>
+#else
+#include <alloca.h>
+#endif
+
typedef unsigned int bitset_pos_t;
#include "bitset_std.h"
bitset_t *ptr = area;
memset(area, 0, _bitset_overall_size(sizeof(bitset_t), size));
ptr->units = _bitset_units(size);
- ptr->size = size;
+ ptr->size = size;
ptr->data = _bitset_data_ptr(area, sizeof(bitset_t), size);
return ptr;
}
{
bitset_pos_t unit_number = pos / BS_UNIT_SIZE_BITS;
- if(unit_number >= bs->units)
+ if(pos >= bs->size)
return -1;
{