Supposing I have:
sdk.h:
#define foo 1
#define bar 1
app.h:
#define foo 0
How can I generate a merged.h that looks like this, given I want app.h to redefine anything already defined in sdk.h:
#define foo 0
#define bar 1
One approach might be "don't do this, just let the preprocessor do it for you". I've tried that and it's not going to work for my situation I don't think. I'm really looking for an approach using a basic shell script.
app.h
after includingsdk.h
. If that doesn't work, then please update your question what exactly it is that goes wrong.sort -k1,2 -u app.h sdk.h
give you the correct results?