diff options
author | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 10:50:15 +0000 |
---|---|---|
committer | nickc <nickc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-10-01 10:50:15 +0000 |
commit | a3fa7febd330f496ccf318605c3b293e092b4028 (patch) | |
tree | f2a375a13ffbab6fc37885d69817a8914b50746e /gcc/c-pragma.h | |
parent | 2ebda888fcd6502d6f6074956be683798967e4c6 (diff) | |
download | gcc-a3fa7febd330f496ccf318605c3b293e092b4028.tar.gz |
Add support for #pragma pack(push,<n>) and #pragma pack(pop).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22710 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-pragma.h')
-rw-r--r-- | gcc/c-pragma.h | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h index 5478977608e..d7a383df4a4 100644 --- a/gcc/c-pragma.h +++ b/gcc/c-pragma.h @@ -18,33 +18,83 @@ along with GNU CC; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifdef HANDLE_SYSV_PRAGMA +#ifndef _C_PRAGMA_H +#define _C_PRAGMA_H +#ifdef HANDLE_SYSV_PRAGMA /* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are defined. */ #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF) #define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK #endif +/* We always support #pragma pack for SYSV pragmas. */ +#ifndef HANDLE_PRAGMA_PACK +#define HANDLE_PRAGMA_PACK 1 +#endif +#endif /* HANDLE_SYSV_PRAGMA */ + + +#ifdef HANDLE_PRAGMA_PACK_PUSH_POP +/* If we are supporting #pragma pack(push... then we automatically + support #pragma pack(<n>) */ +#define HANDLE_PRAGMA_PACK 1 +#define PRAGMA_INSERT_ATTRIBUTES(node, pattr, prefix_attr) \ + insert_pack_attributes (node, pattr, prefix_attr) +extern void insert_pack_attributes PROTO((tree, tree *, tree *)); +#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ + + +#ifdef HANDLE_PRAGMA_WEAK +/* This structure contains any weak symbol declarations waiting to be emitted. */ +struct weak_syms +{ + struct weak_syms * next; + char * name; + char * value; +}; + +/* Declared in varasm.c */ +extern struct weak_syms * weak_decls; +#endif /* HANDLE_PRAGMA_WEAK */ + + +#if defined HANDLE_PRAGMA_PACK || defined HANDLE_PRAGMA_WEAK +/* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma + parsing is to be done. The code in GCC's generic C source files + will only look for the definition of this constant. They will + ignore definitions of HANDLE_PRAGMA_PACk and so on. */ +#define HANDLE_GENERIC_PRAGMAS 1 +#endif + + +#ifdef HANDLE_GENERIC_PRAGMAS enum pragma_state { ps_start, ps_done, - ps_bad, +#ifdef HANDLE_PRAGMA_WEAK ps_weak, ps_name, ps_equals, ps_value, +#endif +#ifdef HANDLE_PRAGMA_PACK ps_pack, ps_left, ps_align, - ps_right + ps_right, +#endif +#ifdef HANDLE_PRAGMA_PACK_PUSH_POP + ps_push, + ps_pop, + ps_comma, +#endif + ps_bad }; -/* Output asm to handle ``#pragma weak'' */ -extern void handle_pragma_weak PROTO((enum pragma_state, char *, char *)); - /* Handle a C style pragma */ extern int handle_pragma_token PROTO((char *, tree)); -#endif /* HANDLE_SYSV_PRAGMA */ +#endif /* HANDLE_GENERIC_PRAGMAS */ +#endif /* _C_PRAGMA_H */ |