diff options
author | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-14 23:35:36 +0000 |
---|---|---|
committer | gdr <gdr@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-14 23:35:36 +0000 |
commit | 06c7407ce2d0227b214b52799b5bd729448228b7 (patch) | |
tree | 66b07837c16817e692a056798f570c35b8bab971 /gcc/diagnostic.h | |
parent | aaa5b7eb0781c6ab195c60a09b3a70e3cd9f5b33 (diff) | |
download | ppe42-gcc-06c7407ce2d0227b214b52799b5bd729448228b7.tar.gz ppe42-gcc-06c7407ce2d0227b214b52799b5bd729448228b7.zip |
* diagnostic.h (output_buffer_state): Redefine.
(output_format_decoder): New macro.
(output_prefixing_rule): Likewise.
(output_line_cutoff): Likewise.
(diagnostic_format_decoder): Adjust.
(diagnostic_prefixing_rule): Likewise.
(diagnostic_line_cutoff): Likewise.
(diagnostic_state): Likewise.
(diagnostic_kind_count): Likewise.
(diagnostic_buffer): Now a macro.
* diagnostic.c (diagnostic_buffer): Remove definition.
(output_is_line_wrapping): Adjust.
(set_real_maximum_length): Likewise.
(output_set_maximum_length): Likewise.
(init_output_buffer): Likewise.
(lhd_print_error_function): Likewise.
(output_do_verbatim): Likewise.
cp/
* error.c (cxx_print_error_function): Adjust call to macros.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52307 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/diagnostic.h')
-rw-r--r-- | gcc/diagnostic.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index 360b64bfa47..925134af48f 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -130,9 +130,8 @@ struct output_buffer printer_fn format_decoder; }; -/* Current state of the diagnostic_context' output_buffer. This macro - accepts both `diagnostic_context *' and `output_buffer *'. */ -#define output_buffer_state(BUFFER) ((output_buffer *)(BUFFER))->state +/* Current state of an output_buffer. */ +#define output_buffer_state(BUFFER) (BUFFER)->state /* The stream attached to the output_buffer, where the formatted diagnostics will ultimately go. Works only on `output_buffer *'. */ @@ -157,6 +156,16 @@ struct output_buffer #define output_message_text(BUFFER) \ ((const char *) obstack_base (&(BUFFER)->obstack)) +/* Client supplied function used to decode formats. */ +#define output_format_decoder(BUFFER) (BUFFER)->format_decoder + +/* Prefixing rule used in formatting a diagnostic message. */ +#define output_prefixing_rule(BUFFER) (BUFFER)->state.prefixing_rule + +/* Maximum characters per line in automatic line wrapping mode. + Zero means don't wrap lines. */ +#define output_line_cutoff(BUFFER) (BUFFER)->state.ideal_maximum_length + /* This data structure bundles altogether any information relevant to the context of a diagnostic message. */ struct diagnostic_context @@ -224,31 +233,29 @@ struct diagnostic_context /* Extension hook for client. */ #define diagnostic_auxiliary_data(DC) (DC)->x_data -/* Client supplied function used to decode formats. Can operate on both - `output_buffer *' and `diagnostic_context *'. */ -#define diagnostic_format_decoder(DC) ((output_buffer *)(DC))->format_decoder +/* Same as output_format_decoder. Works on 'diagnostic_context *'. */ +#define diagnostic_format_decoder(DC) output_format_decoder (&(DC)->buffer) -/* Prefixing rule used in formatting a diagnostic message. Accepts both - `output_buffer *' and `diagnostic_context *'. */ -#define diagnostic_prefixing_rule(DC) \ - ((output_buffer *)(DC))->state.prefixing_rule +/* Same as output_prefixing_rule. Works on 'diagnostic_context *'. */ +#define diagnostic_prefixing_rule(DC) output_prefixing_rule (&(DC)->buffer) /* Maximum characters per line in automatic line wrapping mode. Zero means don't wrap lines. */ -#define diagnostic_line_cutoff(DC) \ - ((output_buffer *)(DC))->state.ideal_maximum_length +#define diagnostic_line_cutoff(DC) output_line_cutoff (&(DC)->buffer) + +/* Same as output_buffer_state, but works on 'diagnostic_context *'. */ +#define diagnostic_state(DC) output_buffer_state (&(DC)->buffer) + +#define diagnostic_buffer (&global_dc->buffer) /* This diagnostic context is used by front-ends that directly output diagnostic messages without going through `error', `warning', and similar functions. */ extern diagnostic_context *global_dc; -/* This will be removed shortly. */ -extern output_buffer *diagnostic_buffer; - /* The total count of a KIND of diagnostics meitted so far. */ #define diagnostic_kind_count(DC, DK) \ - ((output_buffer *)(DC))->state.diagnostic_count[(int) (DK)] + (DC)->buffer.state.diagnostic_count[(int) (DK)] /* The number of errors that have been issued so far. Ideally, these would take an output_buffer as an argument. */ |