Lets say I have a define like so:
#define MY_FUNC_NAME my_func
I want to get a string literal for it, e.g. "my_func"
.
I tried using the hash preprocessor operator like so:
#define str(s) #s
#define MY_FUNC_NAME_LITERAL str(MY_FUNC_NAME)
But this would yield "MY_FUNC_NAME"
instead of "my_func"
, as though it does not replace it before creating the literal.
Any ideas how to achieve that?