Yup, we do it all the time. Remember that when you do a #include that it is the same thing as copy/pasting the included file into your current file.
One thing to be careful of is that enums have scope, so you will want to be careful with the way you name your constants.
If you ran the following
Code:
enum
{
A=1,
B
};
void my_function(void)
{
enum
{
B = 4
}
printf("A: %d B: %d\n",A,B);
}
void main(void)
{
printf("A: %d B: %d\n",A,B);
my_function();
printf("A: %d B: %d\n",A,B);
}
Your output would be
Code:
A: 1 B: 2
A: 1 B: 4
A: 1 B: 2