For some reason I need to temporarily disable some macros in a header file and the #undef MACRONAME will make the code compile but it will undef the existing ma
The macros come from some header file, so you should have access to their values. You can then do something like
#include // declares macro FOO
// Do things with FOO
#undef FOO
// do things without FOO
#include // reenable FOO
Your header should then be designed along these lines
#ifndef FOO
#define FOO do_something(x,y)
#endif