]>
Commit | Line | Data |
---|---|---|
3d6f7931 | 1 | /* Pragma related interfaces. |
6e090c76 | 2 | Copyright (C) 1995, 1998, 1999, 2000 Free Software Foundation, Inc. |
3d6f7931 MM |
3 | |
4 | This file is part of GNU CC. | |
5 | ||
6 | GNU CC is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2, or (at your option) | |
9 | any later version. | |
10 | ||
11 | GNU CC is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with GNU CC; see the file COPYING. If not, write to | |
940d9d63 RK |
18 | the Free Software Foundation, 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. */ | |
3d6f7931 | 20 | |
e2af664c NC |
21 | #ifndef _C_PRAGMA_H |
22 | #define _C_PRAGMA_H | |
f09db6e0 | 23 | |
e2af664c | 24 | #ifdef HANDLE_SYSV_PRAGMA |
daefd78b JM |
25 | /* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_DEF are |
26 | defined. */ | |
27 | #if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_DEF) | |
28 | #define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK | |
3d6f7931 MM |
29 | #endif |
30 | ||
e2af664c NC |
31 | /* We always support #pragma pack for SYSV pragmas. */ |
32 | #ifndef HANDLE_PRAGMA_PACK | |
33 | #define HANDLE_PRAGMA_PACK 1 | |
34 | #endif | |
35 | #endif /* HANDLE_SYSV_PRAGMA */ | |
36 | ||
37 | ||
38 | #ifdef HANDLE_PRAGMA_PACK_PUSH_POP | |
39 | /* If we are supporting #pragma pack(push... then we automatically | |
40 | support #pragma pack(<n>) */ | |
41 | #define HANDLE_PRAGMA_PACK 1 | |
e2af664c NC |
42 | #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */ |
43 | ||
44 | ||
45 | #ifdef HANDLE_PRAGMA_WEAK | |
46 | /* This structure contains any weak symbol declarations waiting to be emitted. */ | |
47 | struct weak_syms | |
48 | { | |
49 | struct weak_syms * next; | |
50 | char * name; | |
51 | char * value; | |
52 | }; | |
53 | ||
54 | /* Declared in varasm.c */ | |
55 | extern struct weak_syms * weak_decls; | |
0e9264a2 | 56 | |
6e090c76 | 57 | extern int add_weak PARAMS ((char *, char *)); |
e2af664c NC |
58 | #endif /* HANDLE_PRAGMA_WEAK */ |
59 | ||
60 | ||
e2af664c NC |
61 | /* Define HANDLE_GENERIC_PRAGMAS if any kind of front-end pragma |
62 | parsing is to be done. The code in GCC's generic C source files | |
63 | will only look for the definition of this constant. They will | |
fc009f96 GK |
64 | ignore definitions of HANDLE_PRAGMA_PACK and so on. |
65 | With #pragma poison, this is always set. */ | |
e2af664c | 66 | #define HANDLE_GENERIC_PRAGMAS 1 |
e2af664c NC |
67 | |
68 | ||
69 | #ifdef HANDLE_GENERIC_PRAGMAS | |
3d6f7931 MM |
70 | enum pragma_state |
71 | { | |
72 | ps_start, | |
73 | ps_done, | |
e2af664c | 74 | #ifdef HANDLE_PRAGMA_WEAK |
3d6f7931 MM |
75 | ps_weak, |
76 | ps_name, | |
77 | ps_equals, | |
78 | ps_value, | |
e2af664c NC |
79 | #endif |
80 | #ifdef HANDLE_PRAGMA_PACK | |
3d6f7931 MM |
81 | ps_pack, |
82 | ps_left, | |
83 | ps_align, | |
e2af664c NC |
84 | ps_right, |
85 | #endif | |
86 | #ifdef HANDLE_PRAGMA_PACK_PUSH_POP | |
0f92adae JM |
87 | ps_push, ps_pushcomma, ps_pushid, ps_pushcomma2, |
88 | ps_pop, ps_popcomma, | |
e2af664c | 89 | #endif |
fc009f96 | 90 | ps_poison, |
e2af664c | 91 | ps_bad |
3d6f7931 MM |
92 | }; |
93 | ||
3d6f7931 | 94 | /* Handle a C style pragma */ |
6e090c76 | 95 | extern int handle_pragma_token PARAMS ((const char *, tree)); |
f09db6e0 | 96 | |
e2af664c | 97 | #endif /* HANDLE_GENERIC_PRAGMAS */ |
568767a6 | 98 | |
6e090c76 | 99 | extern void init_pragma PARAMS ((void)); |
568767a6 | 100 | |
e2af664c | 101 | #endif /* _C_PRAGMA_H */ |