I would like to define a large bitfield for the purpose of quickly monitoring the status a very large structure of elements. Here is what I have so far:
#define T
use
UINT128 blaha;
You're not defining a bitfield.
I'm not sure you understand what a bitfield is. I bitfield is a number of bits. Not an array of structs or similar. What exactly are you expecting that your code should do?
Edit: oh I see now. No, you can't use your own types, just ints.
Try this (untested code):
struct bit1024 {
unsigned char byte[128];
};
struct bit1024 foo;
void
set(struct bit1024*lala, int n, int v)
{
lala->byte[n/8] |= 1<<(n % 8);
if (!v) {
lala->byte[n/8] ^= 1<<(n % 8);
}
}
int
get(struct bit1024*lala, int n)
{
return 1 & (lala->byte[n/8] >> (n % 8));
}