S
sinbad
how to make a macro definition not to be redefined by some other
instance.
for example there are two instances of macro_1,
#define macro_1 20 in some file, and
#define macro_1 30 in some other file which i probably don't know,
more precisely i don't care
even if such defn exists; The thing is i always want macro_1 to be
20.
the simple thing i could've done is remove all other defn's except the
one i wanted. But
that will not work, because #define macro_1 20 will be visible only if
my feature is enabled.
so, i could have done
some_file.c
#ifdef my_feat
#define macro_1 20
#endif
some_other_file.c
#ifndef my_feat
#define macro_1 30
#endif
But this requires me to change some_other_file.c, which i don't want.
Is there any way
of doing this.
instance.
for example there are two instances of macro_1,
#define macro_1 20 in some file, and
#define macro_1 30 in some other file which i probably don't know,
more precisely i don't care
even if such defn exists; The thing is i always want macro_1 to be
20.
the simple thing i could've done is remove all other defn's except the
one i wanted. But
that will not work, because #define macro_1 20 will be visible only if
my feature is enabled.
so, i could have done
some_file.c
#ifdef my_feat
#define macro_1 20
#endif
some_other_file.c
#ifndef my_feat
#define macro_1 30
#endif
But this requires me to change some_other_file.c, which i don't want.
Is there any way
of doing this.