libcpp/
[official-gcc.git] / gcc / c-pragma.h
blob98765555ef4b2b924152359961eed271e615e341
1 /* Pragma related interfaces.
2 Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation; either version 2, or (at your option) any later
10 version.
12 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA. */
22 #ifndef GCC_C_PRAGMA_H
23 #define GCC_C_PRAGMA_H
25 #include <cpplib.h> /* For enum cpp_ttype. */
27 /* Pragma identifiers built in to the front end parsers. Identifiers
28 for anciliary handlers will follow these. */
29 typedef enum pragma_kind {
30 PRAGMA_NONE = 0,
32 PRAGMA_GCC_PCH_PREPROCESS,
34 PRAGMA_FIRST_EXTERNAL
35 } pragma_kind;
37 /* Cause the `yydebug' variable to be defined. */
38 #define YYDEBUG 1
39 extern int yydebug;
41 extern struct cpp_reader* parse_in;
43 #define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
45 #ifdef HANDLE_SYSV_PRAGMA
46 /* We always support #pragma pack for SYSV pragmas. */
47 #ifndef HANDLE_PRAGMA_PACK
48 #define HANDLE_PRAGMA_PACK 1
49 #endif
50 #endif /* HANDLE_SYSV_PRAGMA */
53 #ifdef HANDLE_PRAGMA_PACK_PUSH_POP
54 /* If we are supporting #pragma pack(push... then we automatically
55 support #pragma pack(<n>) */
56 #define HANDLE_PRAGMA_PACK 1
57 #endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
59 /* It's safe to always leave visibility pragma enabled as if
60 visibility is not supported on the host OS platform the
61 statements are ignored. */
62 #define HANDLE_PRAGMA_VISIBILITY 1
64 extern void init_pragma (void);
66 /* Front-end wrappers for pragma registration. */
67 typedef void (*pragma_handler)(struct cpp_reader *);
68 extern void c_register_pragma (const char *, const char *, pragma_handler);
69 extern void c_register_pragma_with_expansion (const char *, const char *,
70 pragma_handler);
71 extern void c_invoke_pragma_handler (unsigned int);
73 extern void maybe_apply_pragma_weak (tree);
74 extern void maybe_apply_pending_pragma_weaks (void);
75 extern tree maybe_apply_renaming_pragma (tree, tree);
76 extern void add_to_renaming_pragma_list (tree, tree);
78 extern enum cpp_ttype pragma_lex (tree *);
80 /* This is not actually available to pragma parsers. It's merely a
81 convenient location to declare this function for c-lex, after
82 having enum cpp_ttype declared. */
83 extern enum cpp_ttype c_lex_with_flags (tree *, location_t *, unsigned char *);
85 /* If 1, then lex strings into the execution character set.
86 If 0, lex strings into the host character set.
87 If -1, lex both, and chain them together, such that the former
88 is the TREE_CHAIN of the latter. */
89 extern int c_lex_string_translate;
91 /* If true, strings should be passed to the caller of c_lex completely
92 unmolested (no concatenation, no translation). */
93 extern bool c_lex_return_raw_strings;
95 #endif /* GCC_C_PRAGMA_H */