View Single Post
Old November 14, 2016, 08:21   #7
AnonymousHero's Avatar
Join Date: Jun 2007
Posts: 1,365
AnonymousHero is on a distinguished road
I think a variation of what fizzix suggested would work:

Write a little code generator which pre-processes the data files into something usable for the C compiler, be it struct definitions or enums or whatever. An added bonus is that the generated definitions/code are easily greppable contrary to the "X macro" pattern.

(Unless I'm misunderstanding the goals here. As long as the values in the data files actually don't change at run-time, what I'm suggesting should work pretty nicely.)
AnonymousHero is offline   Reply With Quote