6.60.12. Push/Pop Macro Pragmas

6.60.12 Push/Pop Macro Pragmas

For compatibility with Microsoft Windows compilers, GCC supports ‘#pragma push_macro("macro_name")’ and ‘#pragma pop_macro("macro_name")’.

#pragma push_macro("macro_name")
This pragma saves the value of the macro named as macro_name to the top of the stack for this macro.
#pragma pop_macro("macro_name")
This pragma sets the value of the macro named as macro_name to the value on top of the stack for this macro. If the stack for macro_name is empty, the value of the macro remains unchanged.

For example:

#define X  1
#pragma push_macro("X")
#undef X