Completing a macro's name with another macro

43 Views Asked by At

I use a library that defines macros. I can make a modification to this library and recompile it but on the condition of not breaking compatibility i.e without impacting anything.

I would like to be able to prefix the name of its macros when compiling the library. So currently, I have:

// In the library :
#define function(i) { cout << i; }

 // In my application:
function(i);

I would like to recompile the library by adding a personal define: -DMYPREFIX_ and use it in this way in my application:

MYPREFIX_function(i);

...and thus make the original macro disappear to avoid name conflicts with others library for example.

I'm struggling a bit..

0

There are 0 best solutions below