Here is a concept, based on assumptions from a clarification comment.
- only one header
- no includes
- no dependency on the including code file
- no dependency on previously included headers
- no dependency on include order
Main requirements otherwise:
- do not risk influence on binary build process
(being the part which makes the actual software product)
- do not try to emulate the binary build compiler/parser
How to:
- make a copy
- include it from a dedicated code file,
which only contains "#include "copy.h";
or directly preprocess the header
(this just feels weirdly against my habits)
- delete everything except preprocessor and pragmas,
paying attention to line-continuation
- replace all "#define"s by "HaPoDefine",
except one (e.g. the first)
- repeat
- preprocess the including code file
(most compiler have a switch to do this)
- save the output
- turn another "HaPoDefine" back into "#define"
- until no "HaPoDefine" is left
- harvest all macro expansions from the deltas of intermediate saves
- discard everything which is not of relevance
- since the final actual numerical value is most likely a result of the compiler (not the preprocessor), use a tool like bashs "expr" to calculate values for human-eye readability,
be careful not to risk differences to binary build process
- use some regex magic to achieve any desired format