{Patch/documentation} PR 35054 Document #pragma push|pop_macro
Danny Smith
dansmister@gmail.com
Tue Feb 5 09:36:00 GMT 2008
This provides missung user documentation for the new extension
#pragma_push_macro and #pragma_pop_macro.
OK for 4.3.0?
:ADDPATCH documentation:
2008-02-05 Danny Smith <dannysmith@users.sourceforge.net>
PR 35054
* doc/extend.texi (Push/Pop Macro Pragmas): Add documentation
for #pragma_push_macro and #pragma_pop_macro
Index: extend.texi
===================================================================
--- extend.texi (revision 131857)
+++ extend.texi (working copy)
@@ -10831,6 +10831,7 @@
* Weak Pragmas::
* Diagnostic Pragmas::
* Visibility Pragmas::
+* Push/Pop Macro Pragmas::
@end menu
@node ARM Pragmas
@@ -11146,6 +11147,34 @@
@end table
+
+@node Push/Pop Macro Pragmas
+@subsection Push/Pop Macro Pragmas
+For compatibility with MSVC, GCC supports the Win32 style pragmas
+@samp{#pragma push_macro(@var{"macro_name"})} and @samp{#pragma
+pop_macro(@var{"macro_name"})}.
+
+@enumerate
+@item @code{#pragma push_macro(@var{"macro_name"})} saves the
+value of the macro named as @var{macro_name} to the top of the stack for
+this macro
+@item @code{#pragma pop_macro(@var{"macro_name"})} sets the
+value of the macro named as @var{macro_name} to the value on top of
+the stack for this macro. If the stack for @var{macro_name} is empty,
+the value of the macro remains unchanged.
+@end enumerate
+
+For example:
+
+@smallexample
+#define X 1
+#pragma push_macro("X")
+#undef X
+#define X -1
+#pragma pop_macro("X")
+int x [X];
+@end smallexample
+
@node Unnamed Fields
@section Unnamed struct/union fields within structs/unions
@cindex struct
More information about the Gcc-patches
mailing list