An attempt to simplify #define handling, not particularly succesful:)