I know there is already a similar post to mine (C++ `ifdef` with concatenation of macros values) but the post is pretty old and the solution provided does not work for me, because I cannot set the define I want to check. So I hope someone can help me.
The problem is that I want to make an ifdef of a concatenation of two a define with a fixed text.
Imagine the following code
#define ENABLE_MODULE_1
enum Modultype
{
MODULE_1,
MODULE_2
};
#define MODULE MODULE_1
int main()
{
#ifdef ENABLE_ ## MODULE
printf("NAME defined");
#else
printf("NAME not defined");
#endif
return 0;
}
So I basically want to check if ENABLE_MODULE_1
is defined based on the MODULE
define.
I hope someone can help me. Thanks!