From 3396dc8065ec59cb307362fa820c58cb5cde9bff Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 10 Jun 2002 06:03:13 +0000 Subject: * cpphash.h (struct cpp_macro): Put comments on their own lines. (_cpp_expansions_different_trad): New. * cppmacro.c (warn_of_redefinition): Fix for traditional case. * cpptrad.c (canonicalize_text): New. (scan_out_logical_line): Handle no arguments correctly. (save_replacement_text): Commit memory when finished. (_cpp_expansions_different_trad): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54432 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cpphash.h | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'gcc/cpphash.h') diff --git a/gcc/cpphash.h b/gcc/cpphash.h index 6baf211958d..6d41ead6237 100644 --- a/gcc/cpphash.h +++ b/gcc/cpphash.h @@ -69,18 +69,35 @@ struct dummy Variadic macros cannot occur with traditional cpp. */ struct cpp_macro { - cpp_hashnode **params; /* Parameters, if any. */ + /* Parameters, if any. */ + cpp_hashnode **params; + + /* Replacement tokens (ISO) or replacement text (traditional). See + comment at top of cpptrad.c for how traditional function-like + macros are encoded. */ union { - cpp_token *tokens; /* Tokens of replacement list (ISO). */ - const uchar *text; /* Expansion text (traditional). */ + cpp_token *tokens; + const uchar *text; } 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. */ + + /* Definition line number. */ + unsigned int line; + + /* Number of tokens in expansion, or bytes for traditional macros. */ + unsigned int count; + + /* Number of parameters. */ + unsigned short paramc; + + /* If a function-like macro. */ + unsigned int fun_like : 1; + + /* If a variadic macro. */ + unsigned int variadic : 1; + + /* If macro defined in system header. */ + unsigned int syshdr : 1; }; /* A generic memory buffer, and operations on it. */ @@ -499,6 +516,7 @@ extern void _cpp_overlay_buffer PARAMS ((cpp_reader *pfile, const uchar *, extern cpp_hashnode *_cpp_lex_identifier_trad PARAMS ((cpp_reader *)); extern void _cpp_set_trad_context PARAMS ((cpp_reader *)); extern bool _cpp_create_trad_definition PARAMS ((cpp_reader *, cpp_macro *)); +extern bool _cpp_expansions_different_trad PARAMS ((cpp_macro *, cpp_macro *)); /* Utility routines and macros. */ #define DSC(str) (const uchar *)str, sizeof str - 1 -- cgit v1.2.1