Real-world use of X-Macros

I discovered X-macros a couple of years ago when I started making use of function pointers in my code. I am an embedded programmer and I use state machines frequently. Often I would write code like this: /* declare an enumeration of state codes */ enum{ STATE0, STATE1, STATE2, … , STATEX, NUM_STATES}; /* declare … Read more