I hate defines. In the quest of eliminating as many of them as possible from an old code base, I need to rely on the enum-hack for defining structures containing arrays. Unfortunately, I'm not getting it to compile when the incriminated .h file gets included by C projects.
typedef struct _P_O {
enum { MAXELEMENTS=10 };
P_O_U elem;
ULONG id[MAXELEMENTS];
USHORT nid;
} P_O, *PP_O;
this produces error C2208:
'type' : no members defined using this type
An identifier resolving to a type name is in an aggregate declaration, but the compiler cannot declare a member.
OT: I hate using a compiler which is 10 y.o., having to mantain old c code and bad design too; not just defines :)