diff options
author | Eric Christopher <echristo@gcc.gnu.org> | 2004-01-16 22:37:49 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gcc.gnu.org> | 2004-01-16 22:37:49 +0000 |
commit | cf551fbaca9987dccd728aa2cbaff67de7393fe3 (patch) | |
tree | 95190a526a0984976fac3a95910e9a5e961bea4e /gcc/cpplib.c | |
parent | 2f9c39f8fc04b38b6aac1ad71c83b22cede8b9e9 (diff) | |
download | gcc-cf551fbaca9987dccd728aa2cbaff67de7393fe3.zip gcc-cf551fbaca9987dccd728aa2cbaff67de7393fe3.tar.gz gcc-cf551fbaca9987dccd728aa2cbaff67de7393fe3.tar.bz2 |
cppcharset.c (one_iso88591_to_utf8): New function.
2004-01-16 Eric Christopher <echristo@redhat.com>
Chandrakala Chavva <cchavva@redhat.com>
* cppcharset.c (one_iso88591_to_utf8): New function.
(convert_iso88591_utf8): Ditto. Use.
(conversion_tab): Use.
(_cpp_input_to_utf8): New function.
(_cpp_init_iconv_buffer): Ditto.
(_cpp_close_iconv_buffer): Ditto.
* cpphash.h: Prototype new functions.
(cpp_buffer): Add input_cset_desc.
* cppinit.c: Add input_charset default.
* cpplib.c (cpp_push_buffer): Support init and
close of iconv.
* cpplib.h (cpp_options): Add input_charset.
From-SVN: r76000
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r-- | gcc/cpplib.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c index 2b213cb..feb8717 100644 --- a/gcc/cpplib.c +++ b/gcc/cpplib.c @@ -549,14 +549,14 @@ do_undef (cpp_reader *pfile) /* Undefine a single macro/assertion/whatever. */ static int -undefine_macros (cpp_reader *pfile, cpp_hashnode *h, +undefine_macros (cpp_reader *pfile, cpp_hashnode *h, void *data_p ATTRIBUTE_UNUSED) { switch (h->type) { case NT_VOID: break; - + case NT_MACRO: if (pfile->cb.undef) (*pfile->cb.undef) (pfile, pfile->directive_line, h); @@ -855,7 +855,7 @@ do_linemarker (cpp_reader *pfile) cpp_string s = { 0, 0 }; if (_cpp_interpret_string_notranslate (pfile, &token->val.str, &s)) new_file = (const char *)s.text; - + new_sysp = 0; flag = read_flag (pfile, 0); if (flag == 1) @@ -1159,7 +1159,7 @@ do_pragma (cpp_reader *pfile) (*p->u.handler) (pfile); if (pfile->cb.line_change) (*pfile->cb.line_change) (pfile, pfile->cur_token, false); - + } else if (pfile->cb.def_pragma) { @@ -1925,6 +1925,7 @@ cpp_push_buffer (cpp_reader *pfile, const uchar *buffer, size_t len, int from_stage3) { cpp_buffer *new = xobnew (&pfile->buffer_ob, cpp_buffer); + const char *input = CPP_OPTION (pfile, input_charset); /* Clears, amongst other things, if_stack and mi_cmacro. */ memset (new, 0, sizeof (cpp_buffer)); @@ -1936,6 +1937,8 @@ cpp_push_buffer (cpp_reader *pfile, const uchar *buffer, size_t len, new->need_line = true; pfile->buffer = new; + _cpp_init_iconv_buffer (pfile, input); + return new; } @@ -1957,6 +1960,8 @@ _cpp_pop_buffer (cpp_reader *pfile) /* In case of a missing #endif. */ pfile->state.skipping = 0; + _cpp_close_iconv_buffer (pfile); + /* _cpp_do_file_change expects pfile->buffer to be the new one. */ pfile->buffer = buffer->prev; |