So far I’ve got as far as:
#define ADEFINE "23"
#pragma message ("ADEFINE" ADEFINE)
Which works, but what if ADEFINE isn’t a string?
#define ADEFINE 23
#pragma message ("ADEFINE" ADEFINE)
causes:
warning: malformed ‘#pragma message’, ignored
Ideally I’d like to be able to deal with any value, including undefined.
To display macros which aren’t strings, stringify the macro:
If you have/want boost, you can use boost stringize to do it for you: