OSDN Git Service

* include/cpp-id-data.h: Add extern "C".
[pf3gnuchains/gcc-fork.git] / libcpp / include / cpp-id-data.h
1 /* Structures that hang off cpp_identifier, for PCH.
2    Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
3    1999, 2000, 2001, 2002, 2003, 2004, 2009 Free Software Foundation, Inc.
4
5 This program is free software; you can redistribute it and/or modify it
6 under the terms of the GNU General Public License as published by the
7 Free Software Foundation; either version 3, or (at your option) any
8 later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; see the file COPYING3.  If not see
17 <http://www.gnu.org/licenses/>.  */
18
19 #include "cpplib.h"
20
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24
25 #if !defined (HAVE_UCHAR) && !defined (IN_GCC)
26 typedef unsigned char uchar;
27 #endif
28
29 #define UC (const unsigned char *)  /* Intended use: UC"string" */
30
31 /* Chained list of answers to an assertion.  */
32 struct GTY(()) answer {
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.  */
40 struct GTY(()) cpp_macro {
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;
54     const unsigned char * GTY ((tag ("1"))) text;
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;
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;
85 };
86
87 #ifdef __cplusplus
88 }
89 #endif