I am wondering if there is anyway to stringify a macro expanision that is another macro before it gets completley expanded. Easier to show in code:
#define A_MACRO 0
#define ANOTHER_MACRO A_MACRO
I want to expand ANOTHER_MACRO
into the string "A_MACRO"
Double stringification does not work, it stringifies ANOTHER_MACRO
into 0
. I have searched and cannot find an answer and played around with macros in a test application, but I have had no luck. Is it possible?
Edit: I do not have the ability to change either macro. A_MACRO has a descriptive name that I would like to use, and we "point" to it with another macro that follows a standard name and I can grab it with a file parser. I was hoping I could just write a stringification macro to get that name, but I think I will have to find a way to latch onto it with my file parser, thanks everyone for your help.