From 20cef83acca722837e262ac90c4f5fce51559274 Mon Sep 17 00:00:00 2001 From: Danny Smith Date: Thu, 13 Mar 2008 07:06:30 +0000 Subject: re PR target/35054 (No documentation of #pragma push_macro("macro_name")) PR 35054 * doc/extend.texi (Structure-Packing Pragmas): Replace "Win32" with the phrase "Microsoft Windows compilers". (Push/Pop Macro Pragmas): New subsection. Document #pragma push_macro and pragma pop_macro. From-SVN: r133161 --- gcc/ChangeLog | 8 ++++++++ gcc/doc/extend.texi | 46 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 49 insertions(+), 5 deletions(-) (limited to 'gcc') diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d64295d..98dc171 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2008-03-13 Danny Smith + + PR 35054 + * doc/extend.texi (Structure-Packing Pragmas): Replace "Win32" + with the phrase "Microsoft Windows compilers". + (Push/Pop Macro Pragmas): New subsection. Document + #pragma push_macro and pragma pop_macro. + 2008-03-12 Paul Brook * config/arm/arm.c (output_move_double): Prefer LDRD to LDM. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 9dbdc8e..5dfbbcf 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -10868,6 +10868,7 @@ for further explanation. * Weak Pragmas:: * Diagnostic Pragmas:: * Visibility Pragmas:: +* Push/Pop Macro Pragmas:: @end menu @node ARM Pragmas @@ -11064,11 +11065,11 @@ way of knowing that that happened.) @node Structure-Packing Pragmas @subsection Structure-Packing Pragmas -For compatibility with Win32, GCC supports a set of @code{#pragma} -directives which change the maximum alignment of members of structures -(other than zero-width bitfields), unions, and classes subsequently -defined. The @var{n} value below always is required to be a small power -of two and specifies the new alignment in bytes. +For compatibility with Microsoft Windows compilers, GCC supports a +set of @code{#pragma} directives which change the maximum alignment of +members of structures (other than zero-width bitfields), unions, and +classes subsequently defined. The @var{n} value below always is required +to be a small power of two and specifies the new alignment in bytes. @enumerate @item @code{#pragma pack(@var{n})} simply sets the new alignment. @@ -11183,6 +11184,41 @@ member or instantiation, you must use an attribute. @end table + +@node Push/Pop Macro Pragmas +@subsection Push/Pop Macro Pragmas + +For compatibility with Microsoft Windows compilers, GCC supports +@samp{#pragma push_macro(@var{"macro_name"})} +and @samp{#pragma pop_macro(@var{"macro_name"})}. + +@table @code +@item #pragma push_macro(@var{"macro_name"}) +@cindex pragma, push_macro +This pragma saves the value of the macro named as @var{macro_name} to +the top of the stack for this macro. + +@item #pragma pop_macro(@var{"macro_name"}) +@cindex pragma, pop_macro +This pragma 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 table + +For example: + +@smallexample +#define X 1 +#pragma push_macro("X") +#undef X +#define X -1 +#pragma pop_macro("X") +int x [X]; +@end smallexample + +In this example, the definition of X as 1 is saved by @code{#pragma +push_macro} and restored by @code{#pragma pop_macro}. + @node Unnamed Fields @section Unnamed struct/union fields within structs/unions @cindex struct -- cgit v1.1