I have this code:
#ifdef something32 <----- might not be defined
the_real_value = thing[something32];
thing[something32] = my_value;
#else
the_real_value = thing[something]; <------- guarantied to be defined (something)
thing[something] = my_value;
#endif
#ifdef THE_OTHER_THING <--------- might not be defined
#ifdef something32
thing32[something32] = my_value;
#else
thing32[something] = my_value;
#endif
#endif
and I'll be using that a lot of times so I'd like to replace it with a macro. I know #ifdef's can't live insde a macro so I'm wondering how else I could replace all that code. Any ideas?
EDIT:
I'm sorry, I forgot to mention that something32
is just one of a pretty long list of variables.
The idea is to have something like
SHORTEN_MY_CODE(something, something32);
SHORTEN_MY_CODE(another_something, another_something32);
etc...