Let's say that I have the code as follows:
L - A common library (source) (via svn:extern)
X - My project
Y - A static library (source) (via svn:extern) compiled with X and depends on L
Inside L
there is a macro that is widely used in code X
andY
#define FOO() printf("Hello World\n")
I want to change it to
#define FOO() printf("===> Hello World <===")
Now I know what in my code X
I can do:
#ifdef FOO
#undef FOO
#define FOO() printf("===> Hello World <===")
#endif
which works great for X
but doesn't help for any code in Y
and compilation. I could change the code Y
either L
locally, but then I can’t check my modifications, as this can violate other expectations of the project, which does FOO
.
, , -D
? , Makefile, , X
, FOO
. -D
, X
Y
#include
L, ( , ).