Calculation of sizof through macro. Possible?
Hi,
I need help on calculating sizeof through a macro. I have the folloing layout.
In file "One.h"
Code:
typedef uint16_t tTime;
And in file "Two.h" I want to calculate as follwing:
Code:
#include "One.h"
#define NODE_LENGTH 6
#define TOT_SIZE NODE_LENGTH + sizeof(tTime)
#if (TOT_SIZE > 100)
#error "TOT_SIZE too big."
#endif
I get the following compiling error:
Code:
missing binary operator before '('
How can I get pass this? I don't want to 'hard code' the TOT_SIZE.
Thanks in advance,
Indy