summaryrefslogtreecommitdiff
path: root/gcc/cpplib.c
diff options
context:
space:
mode:
authorzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-10 23:16:31 +0000
committerzack <zack@138bc75d-0d04-0410-961f-82ee72b054a4>2003-07-10 23:16:31 +0000
commit9a432f9acc5fce15865980c8185d20e991fe005b (patch)
treeaecfe84fc61678543cc3833bd2320e614dbbd339 /gcc/cpplib.c
parentaa804853a7c917a6e83082e935defb218e1eb67c (diff)
downloadgcc-9a432f9acc5fce15865980c8185d20e991fe005b.tar.gz
* cppcharset.c (one_utf8_to_cppchar, one_cppchar_to_utf8,
one_utf8_to_utf32, one_utf32_to_utf8, one_utf8_to_utf16, one_utf16_to_utf8, conversion_loop, convert_utf8_utf16, convert_utf8_utf32, convert_utf16_utf8, convert_utf32_utf8, convert_no_conversion, convert_using_iconv): New functions. (APPLY_CONVERSION): New macro. (struct conversion, conversion_tab): New data structure. (init_iconv_desc): Check conversion_tab for a custom conversion primitive before trying to use iconv. (convert_cset): Deleted. (cpp_init_iconv): Use UTF- terminology, not UCS-. (_cpp_destroy_iconv): Update to match. (_cpp_valid_ucn): We don't need iconv to implement UCNs. (convert_ucn): Use one_cppchar_to_utf8 and APPLY_CONVERSION. (convert_escape, cpp_interpret_string): Use APPLY_CONVERSION. (_cpp_interpret_string_notranslate): New function, moved here from cpplib.c. * cpphash.h (convert_f, struct cset_converter): New types. (struct cpp_reader): narrow_cset_desc and wide_cset_desc are now struct cset_converter, not bare iconv_t. Update prototypes. * cpplib.c (interpret_string_notranslate): Moved to cppcharset.c; all callers changed. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@69204 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplib.c')
-rw-r--r--gcc/cpplib.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 2fac44e62fd..1dfef726954 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -733,21 +733,6 @@ strtoul_for_line (const uchar *str, unsigned int len, long unsigned int *nump)
return 0;
}
-/* Subroutine of do_line and do_linemarker. Convert escape sequences
- in a string, but do not perform character set conversion. */
-static bool
-interpret_string_notranslate (cpp_reader *pfile, const cpp_string *in,
- cpp_string *out)
-{
- iconv_t save_narrow_cset_desc = pfile->narrow_cset_desc;
- bool retval;
-
- pfile->narrow_cset_desc = (iconv_t) -1;
- retval = cpp_interpret_string (pfile, in, 1, out, false);
- pfile->narrow_cset_desc = save_narrow_cset_desc;
- return retval;
-}
-
/* Interpret #line command.
Note that the filename string (if any) is a true string constant
(escapes are interpreted), unlike in #line. */
@@ -780,7 +765,7 @@ do_line (cpp_reader *pfile)
if (token->type == CPP_STRING)
{
cpp_string s = { 0, 0 };
- if (interpret_string_notranslate (pfile, &token->val.str, &s))
+ if (_cpp_interpret_string_notranslate (pfile, &token->val.str, &s))
new_file = (const char *)s.text;
check_eol (pfile);
}
@@ -829,7 +814,7 @@ do_linemarker (cpp_reader *pfile)
if (token->type == CPP_STRING)
{
cpp_string s = { 0, 0 };
- if (interpret_string_notranslate (pfile, &token->val.str, &s))
+ if (_cpp_interpret_string_notranslate (pfile, &token->val.str, &s))
new_file = (const char *)s.text;
new_sysp = 0;