I want to use a variable which functions as a bit field
Make sure that the variable type holds all flags. An int holds 4 bytes (32bit) and a long holds 8 bytes (64bit). If you just have 8 flags, use a char, because that is stored as 1 byte. Especially in network scenarios such consideration are interesting.
I read that I cannot use enum for that, but how do I define these in lite-c?
Enums are not supported in Lite-C and they aren't flags. They are just constant names assigned to a numeric integer value. So if you have in C/C++ e.g.
enum { Apple, Orange, Banana, Melon } Fruit;
you could do something like that:
Internally, they translate to constants like 0, 1 and 2. So, to emulate enums in Lite-C, you could do this, although it involves more writing:
#define Apple 1
#define Orange 3
#define Banana 5
#define Melon 7
typedef int Fruit;
Fruit fruit = Apple;
if (fruit == Melon)
error("Shh you got to, shake it, shh shake it, shake it, got to shake it");
else
if (fruit == Banana)
error("(Shake it sugar) shake it like a Polaroid Picture");