I have an application which needs to define indexes in various .h files in a heirarchical manor. There is a large set of common entries in a single file and a number of variant header files that are pulled in to specific projects.
In file: "base.h"
#define AAA 1
#define BBB 2
#define CCC 3
In many files like: "variant_extended.h"
#define XXX 4
#define YYY 5
#define ZZZ 6
However, this is cumbersome, is the a simple way to carry on from base.h and auto number the defines in the build process?
I am frequently editing the files to reorder or insert new entries which leads to a lot of manual managament. I need to also, ensure the numbers start at 0 and are contiguous. These will be indexes in an array (like mailboxes).