The following code does not compile:
#define SOME_MACRO(x,y) x+y
#define ADD_ONE_TO(x) SOME_MACRO(x,1)
#undef SOME_MACRO
int main(){
ADD_ONE_TO(1);
}
Is there any hack to either:
- Prevent code duplication by having common functionality in SOME_MACRO and using it in other macros BUT undef`ing it to prevent its usage in common user-code.
- Somehow making it so the ADD_ONE_TO macro just copy-pastes the macros it uses instead of referncing them.
- Preventing user-code from accessing and using SOME_MACRO but allowing it to be used in other specific parts of code(other, select, macros)
- Hide the implementation of macros by disallowing access(undef or otherwise) to the macros inside the macro which we want to hide the implementation of.