summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index a059e2b0aac..6d3f1b9fb09 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -126,16 +126,36 @@ struct tokenrun
cpp_token *base, *limit;
};
+/* Accessor macros for struct cpp_context. */
+#define FIRST(c) (c->u.iso.first)
+#define LAST(c) (c->u.iso.last)
+#define CUR(c) (c->u.trad.cur)
+#define RLIMIT(c) (c->u.trad.rlimit)
+
typedef struct cpp_context cpp_context;
struct cpp_context
{
/* Doubly-linked list. */
cpp_context *next, *prev;
- /* Contexts other than the base context are contiguous tokens.
- e.g. macro expansions, expanded argument tokens. */
- union utoken first;
- union utoken last;
+ union
+ {
+ /* For ISO macro expansion. Contexts other than the base context
+ are contiguous tokens. e.g. macro expansions, expanded
+ argument tokens. */
+ struct
+ {
+ union utoken first;
+ union utoken last;
+ } iso;
+
+ /* For traditional macro expansion. */
+ struct
+ {
+ const uchar *cur;
+ const uchar *rlimit;
+ } trad;
+ } u;
/* If non-NULL, a buffer used for storage related to this context.
When the context is popped, the buffer is released. */