]> git.ipfire.org Git - thirdparty/gcc.git/blame - libcpp/include/cpp-id-data.h
cpp-id-data.h: Add extern "C".
[thirdparty/gcc.git] / libcpp / include / cpp-id-data.h
CommitLineData
d8044160
GK
1/* Structures that hang off cpp_identifier, for PCH.
2 Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
748086b7 3 1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
d8044160
GK
4
5This program is free software; you can redistribute it and/or modify it
6under the terms of the GNU General Public License as published by the
748086b7 7Free Software Foundation; either version 3, or (at your option) any
d8044160
GK
8later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
748086b7
JJ
16along with this program; see the file COPYING3. If not see
17<http://www.gnu.org/licenses/>. */
d8044160
GK
18
19#include "cpplib.h"
20
4851089f
ILT
21#ifdef __cplusplus
22extern "C" {
23#endif
24
c812785a 25#if !defined (HAVE_UCHAR) && !defined (IN_GCC)
d8044160
GK
26typedef unsigned char uchar;
27#endif
c812785a 28
b6baa67d 29#define UC (const unsigned char *) /* Intended use: UC"string" */
d8044160
GK
30
31/* Chained list of answers to an assertion. */
d1b38208 32struct GTY(()) answer {
d8044160
GK
33 struct answer *next;
34 unsigned int count;
35 cpp_token GTY ((length ("%h.count"))) first[1];
36};
37
38/* Each macro definition is recorded in a cpp_macro structure.
39 Variadic macros cannot occur with traditional cpp. */
d1b38208 40struct GTY(()) cpp_macro {
d8044160
GK
41 /* Parameters, if any. */
42 cpp_hashnode ** GTY ((nested_ptr (union tree_node,
43 "%h ? CPP_HASHNODE (GCC_IDENT_TO_HT_IDENT (%h)) : NULL",
44 "%h ? HT_IDENT_TO_GCC_IDENT (HT_NODE (%h)) : NULL"),
45 length ("%h.paramc")))
46 params;
47
48 /* Replacement tokens (ISO) or replacement text (traditional). See
49 comment at top of cpptrad.c for how traditional function-like
50 macros are encoded. */
51 union cpp_macro_u
52 {
53 cpp_token * GTY ((tag ("0"), length ("%0.count"))) tokens;
c812785a 54 const unsigned char * GTY ((tag ("1"))) text;
d8044160
GK
55 } GTY ((desc ("%1.traditional"))) exp;
56
57 /* Definition line number. */
58 source_location line;
59
60 /* Number of tokens in expansion, or bytes for traditional macros. */
61 unsigned int count;
62
63 /* Number of parameters. */
64 unsigned short paramc;
65
66 /* If a function-like macro. */
67 unsigned int fun_like : 1;
68
69 /* If a variadic macro. */
70 unsigned int variadic : 1;
71
72 /* If macro defined in system header. */
73 unsigned int syshdr : 1;
74
75 /* Nonzero if it has been expanded or had its existence tested. */
76 unsigned int used : 1;
77
78 /* Indicate which field of 'exp' is in use. */
79 unsigned int traditional : 1;
aa508502
JM
80
81 /* Indicate whether the tokens include extra CPP_PASTE tokens at the
82 end to track invalid redefinitions with consecutive CPP_PASTE
83 tokens. */
84 unsigned int extra_tokens : 1;
d8044160 85};
4851089f
ILT
86
87#ifdef __cplusplus
88}
89#endif