diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-05-16 05:53:24 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-05-16 05:53:24 +0000 |
commit | 601328bb239e7d7af92e00a006d2fb772120c485 (patch) | |
tree | 9c92465466bc6540fc41e7c24db7796904c385b9 /gcc/cpphash.h | |
parent | f4b251a67a849b89d2b21aa54db59891479d1111 (diff) | |
download | gcc-601328bb239e7d7af92e00a006d2fb772120c485.zip gcc-601328bb239e7d7af92e00a006d2fb772120c485.tar.gz gcc-601328bb239e7d7af92e00a006d2fb772120c485.tar.bz2 |
cpphash.h (cpp_macro): Move here, and make expansion a union.
* cpphash.h (cpp_macro): Move here, and make expansion a union.
* cppmacro.c (cpp_macro): Remove.
(enter_macro_context, replace_args, warn_of_redefinition,
_cpp_create_definition, cpp_macro_definition): Update.
From-SVN: r53509
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 7baf8ff..3d82316 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -29,6 +29,9 @@ struct directive; /* Deliberately incomplete. */ struct pending_option; struct op; +typedef unsigned char uchar; +#define U (const uchar *) /* Intended use: U"string" */ + #define BITS_PER_CPPCHAR_T (CHAR_BIT * sizeof (cppchar_t)) /* Test if a sign is valid within a preprocessing number. */ @@ -47,6 +50,24 @@ struct op; efficiency, and partly to limit runaway recursion. */ #define CPP_STACK_MAX 200 +/* Each macro definition is recorded in a cpp_macro structure. + Variadic macros cannot occur with traditional cpp. */ +struct cpp_macro +{ + cpp_hashnode **params; /* Parameters, if any. */ + union + { + cpp_token *tokens; /* Tokens of replacement list (ISO). */ + const uchar *text; /* Expansion text (traditional). */ + } exp; + unsigned int line; /* Starting line number. */ + unsigned int count; /* Number of tokens / bytes in expansion. */ + unsigned short paramc; /* Number of parameters. */ + unsigned int fun_like : 1; /* If a function-like macro. */ + unsigned int variadic : 1; /* If a variadic macro. */ + unsigned int syshdr : 1; /* If macro defined in system header. */ +}; + /* A generic memory buffer, and operations on it. */ typedef struct _cpp_buff _cpp_buff; struct _cpp_buff @@ -436,9 +457,6 @@ extern void _cpp_pop_buffer PARAMS ((cpp_reader *)); /* These are inline functions instead of macros so we can get type checking. */ -typedef unsigned char uchar; -#define U (const uchar *) /* Intended use: U"string" */ - static inline int ustrcmp PARAMS ((const uchar *, const uchar *)); static inline int ustrncmp PARAMS ((const uchar *, const uchar *, size_t)); |