aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorZack Weinberg <zack@rabi.phys.columbia.edu>1998-12-07 14:15:29 +0000
committerDave Brolley <brolley@gcc.gnu.org>1998-12-07 09:15:29 -0500
commitc50bca0894c554662fbd42728bd118d7b9f41b49 (patch)
tree88adc2af69a7da636a68ab4d8b14fa33e27d1ed3 /gcc/cpplib.h
parentf1a86df6cbc181439d3c1b402275110c9debd76d (diff)
downloadgcc-c50bca0894c554662fbd42728bd118d7b9f41b49.zip
gcc-c50bca0894c554662fbd42728bd118d7b9f41b49.tar.gz
gcc-c50bca0894c554662fbd42728bd118d7b9f41b49.tar.bz2
cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM so it'll work on non-ASCII platforms.
1998-12-07 Zack Weinberg <zack@rabi.phys.columbia.edu> * cpplib.c (initialize_char_syntax): Use ISALPHA and ISALNUM so it'll work on non-ASCII platforms. Always consider $ an identifier character. Take no arguments. (cpp_reader_init): Call initialize_char_syntax with no arguments. (cpp_start_read): Don't call initialize_char_syntax again. Clear is_idchar['$'] and is_idstart['$'] if not opts->dollars_in_ident. * cpplib.h (struct cpp_reader): Replace void *data element by cpp_options *opts. Rearrange elements to make gdb printout less annoying (put buffer stack at end). (CPP_OPTIONS): Get rid of now-unnecessary cast. * cppmain.c: s/data/opts/ when initializing cpp_reader structure. * c-decl.c: Likewise. * objc/objc-act.c: Likewise. * fix-header.c: Likewise. From-SVN: r24154
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 3cb2753..65c286b 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -156,13 +156,11 @@ typedef struct assertion_hashnode ASSERTION_HASHNODE;
Applying cpp_get_token repeatedly yields a stream of pre-processor
tokens. Usually, there is only one cpp_reader object active. */
-struct cpp_reader {
+struct cpp_reader
+{
parse_underflow_t get_token;
cpp_buffer *buffer;
- cpp_buffer buffer_stack[CPP_STACK_MAX];
-
- int errors; /* Error counter for exit code */
- void *data;
+ cpp_options *opts;
/* A buffer used for both for cpp_get_token's output, and also internally. */
unsigned char *token_buffer;
@@ -171,6 +169,9 @@ struct cpp_reader {
/* End of the written part of token_buffer. */
unsigned char *limit;
+ /* Error counter for exit code */
+ int errors;
+
/* Line where a newline was first seen in a string constant. */
int multiline_string_line;
@@ -247,6 +248,8 @@ struct cpp_reader {
#ifdef __cplusplus
~cpp_reader () { cpp_cleanup (this); }
#endif
+
+ cpp_buffer buffer_stack[CPP_STACK_MAX];
};
#define CPP_FATAL_LIMIT 1000
@@ -288,14 +291,14 @@ struct cpp_reader {
#define CPP_ADJUST_WRITTEN(PFILE,DELTA) ((PFILE)->limit += (DELTA))
#define CPP_SET_WRITTEN(PFILE,N) ((PFILE)->limit = (PFILE)->token_buffer + (N))
-#define CPP_OPTIONS(PFILE) ((cpp_options *) (PFILE)->data)
+#define CPP_OPTIONS(PFILE) ((PFILE)->opts)
#define CPP_BUFFER(PFILE) ((PFILE)->buffer)
#define CPP_PREV_BUFFER(BUFFER) ((BUFFER)+1)
/* The bottom of the buffer stack. */
#define CPP_NULL_BUFFER(PFILE) (&(PFILE)->buffer_stack[CPP_STACK_MAX])
-/* Pointed to by cpp_reader::data. */
+/* Pointed to by cpp_reader.opts. */
struct cpp_options {
char *in_fname;