summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/Makefile.in3
-rw-r--r--gcc/c-parse.in4
-rw-r--r--gcc/config.in4
-rw-r--r--gcc/config/linux-aout.h8
-rw-r--r--gcc/config/linux.h8
-rw-r--r--gcc/config/sparc/linux.h8
-rw-r--r--gcc/config/svr4.h4
-rwxr-xr-xgcc/configure15
-rw-r--r--gcc/configure.in9
-rw-r--r--gcc/mbchar.c331
-rw-r--r--gcc/mbchar.h41
-rw-r--r--gcc/system.h2
13 files changed, 16 insertions, 435 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a41455e1d89..e0c44ebaa51 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+2003-07-06 Neil Booth <neil@daikokuya.co.uk>
+
+ * Makfile.in: Remove traces of mbchar.
+ * c-parse.in (MULTIBYTE_CHARS): Remove.
+ * config.in (MULTIBYTE_CHARS): Remove.
+ * configure: Remove --enable-mbchar.
+ * configure.in: Remove --enable-mbchar.
+ * mbchar.c, mbchar.h: Remove.
+ * system.h: Poison MULTIBYTE_CHARS.
+ * config/linux-aout.h (MULTIBYTE_CHARS): Remove.
+ * config/linux.h (MULTIBYTE_CHARS): Remove.
+ * config/svr4.h (MULTIBYTE_CHARS): Remove.
+ * config/sparc/linux.h (MULTIBYTE_CHARS): Remove.
+
2003-07-06 Andreas Jaeger <aj@suse.de>
* varray.c (varray_check_failed): Fix typo.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 7b475735f66..5ebb42bd1a0 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -813,7 +813,7 @@ OBJS = alias.o bb-reorder.o bitmap.o builtins.o caller-save.o calls.o \
haifa-sched.o hashtable.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o \
insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
- loop.o mbchar.o optabs.o options.o opts.o params.o postreload.o predict.o \
+ loop.o optabs.o options.o opts.o params.o postreload.o predict.o \
print-rtl.o print-tree.o value-prof.o \
profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \
real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
@@ -1283,7 +1283,6 @@ c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
flags.h toplev.h $(C_COMMON_H) real.h
c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
-mbchar.o: mbchar.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) mbchar.h
graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \
$(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index b62f2ff7294..6eaa354c02b 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -50,10 +50,6 @@ end ifc
#include "toplev.h"
#include "ggc.h"
-#ifdef MULTIBYTE_CHARS
-#include <locale.h>
-#endif
-
ifobjc
#include "objc-act.h"
end ifobjc
diff --git a/gcc/config.in b/gcc/config.in
index d17fd693ceb..27b807b1176 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -335,10 +335,6 @@
/* Define if valgrind's memcheck.h header is installed. */
#undef HAVE_MEMCHECK_H
-/* Define if you want the C and C++ compilers to support multibyte
- character sets for source code. */
-#undef MULTIBYTE_CHARS
-
/* Always define this when using the GNU C Library */
#undef _GNU_SOURCE
diff --git a/gcc/config/linux-aout.h b/gcc/config/linux-aout.h
index f63efd47790..5701fd94ded 100644
--- a/gcc/config/linux-aout.h
+++ b/gcc/config/linux-aout.h
@@ -22,14 +22,6 @@ Boston, MA 02111-1307, USA. */
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
-/* GNU/Linux uses ctype from glibc.a. I am not sure how complete it is.
- For now, we play safe. It may change later. */
-
-#if 0
-#undef MULTIBYTE_CHARS
-#define MULTIBYTE_CHARS 1
-#endif
-
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}} %{static:-static}"
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 15c83b0d8c9..75b403057e2 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -23,14 +23,6 @@ Boston, MA 02111-1307, USA. */
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
-/* GNU/Linux uses ctype from glibc.a. I am not sure how complete it is.
- For now, we play safe. It may change later. */
-
-#if 0
-#undef MULTIBYTE_CHARS
-#define MULTIBYTE_CHARS 1
-#endif
-
#undef ASM_APP_ON
#define ASM_APP_ON "#APP\n"
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index d2f016d1794..a7a48e60c2d 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -35,14 +35,6 @@ Boston, MA 02111-1307, USA. */
/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
-/* GNU/Linux uses ctype from glibc.a. I am not sure how complete it is.
- For now, we play safe. It may change later. */
-
-#if 0
-#undef MULTIBYTE_CHARS
-#define MULTIBYTE_CHARS 1
-#endif
-
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
diff --git a/gcc/config/svr4.h b/gcc/config/svr4.h
index d865959f3c9..714326a5f43 100644
--- a/gcc/config/svr4.h
+++ b/gcc/config/svr4.h
@@ -202,8 +202,4 @@ Boston, MA 02111-1307, USA.
#undef WCHAR_TYPE_SIZE
#define WCHAR_TYPE_SIZE BITS_PER_WORD
-/* This causes trouble, because it requires the host machine
- to support ANSI C. */
-/* #define MULTIBYTE_CHARS */
-
#define TARGET_HAS_F_SETLKW
diff --git a/gcc/configure b/gcc/configure
index 74995a9006f..b685553bdcc 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -52,8 +52,6 @@ ac_help="$ac_help
ac_help="$ac_help
--enable-__cxa_atexit enable __cxa_atexit for C++"
ac_help="$ac_help
- --enable-c-mbchar enable multibyte characters for C and C++"
-ac_help="$ac_help
--enable-threads enable thread usage for target GCC
--enable-threads=LIB use LIB thread package for target GCC"
ac_help="$ac_help
@@ -2147,19 +2145,6 @@ if test "${enable___cxa_atexit+set}" = set; then
fi
-# Enable Multibyte Characters for C/C++
-# Check whether --enable-c-mbchar or --disable-c-mbchar was given.
-if test "${enable_c_mbchar+set}" = set; then
- enableval="$enable_c_mbchar"
- if test x$enable_c_mbchar != xno; then
- cat >> confdefs.h <<\EOF
-#define MULTIBYTE_CHARS 1
-EOF
-
-fi
-fi
-
-
# Enable threads
# Pass with no value to take the default
# Pass with a value to specify a thread package
diff --git a/gcc/configure.in b/gcc/configure.in
index ddb4615bc4d..869ce8d3567 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -469,15 +469,6 @@ AC_ARG_ENABLE(__cxa_atexit,
[ --enable-__cxa_atexit enable __cxa_atexit for C++],
[], [])
-# Enable Multibyte Characters for C/C++
-AC_ARG_ENABLE(c-mbchar,
-[ --enable-c-mbchar enable multibyte characters for C and C++],
-if test x$enable_c_mbchar != xno; then
- AC_DEFINE(MULTIBYTE_CHARS, 1,
- [Define if you want the C and C++ compilers to support multibyte
- character sets for source code.])
-fi)
-
# Enable threads
# Pass with no value to take the default
# Pass with a value to specify a thread package
diff --git a/gcc/mbchar.c b/gcc/mbchar.c
deleted file mode 100644
index 81b87540a2c..00000000000
--- a/gcc/mbchar.c
+++ /dev/null
@@ -1,331 +0,0 @@
-/* Multibyte Character Functions.
- Copyright (C) 1998, 2003 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-/* Note regarding cross compilation:
-
- In general, translation of multibyte characters to wide characters can
- only work in a native compiler since the translation function (mbtowc)
- needs to know about both the source and target character encoding. However,
- this particular implementation for JIS, SJIS and EUCJP source characters
- will work for any compiler with a newlib target. Other targets may also
- work provided that their wchar_t implementation is 2 bytes and the encoding
- leaves the source character values unchanged (except for removing the
- state shifting markers). */
-
-#include "config.h"
-#ifdef MULTIBYTE_CHARS
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-#include "mbchar.h"
-#include <locale.h>
-
-typedef enum {ESCAPE, DOLLAR, BRACKET, AT, B, J, NUL, JIS_CHAR, OTHER,
- JIS_C_NUM} JIS_CHAR_TYPE;
-
-typedef enum {ASCII, A_ESC, A_ESC_DL, JIS, JIS_1, JIS_2, J_ESC, J_ESC_BR,
- J2_ESC, J2_ESC_BR, INV, JIS_S_NUM} JIS_STATE;
-
-typedef enum {COPYA, COPYJ, COPYJ2, MAKE_A, MAKE_J, NOOP,
- EMPTY, ERROR} JIS_ACTION;
-
-/* State/action tables for processing JIS encoding:
-
- Where possible, switches to JIS are grouped with proceding JIS characters
- and switches to ASCII are grouped with preceding JIS characters.
- Thus, maximum returned length is:
- 2 (switch to JIS) + 2 (JIS characters) + 2 (switch back to ASCII) = 6. */
-
-static const JIS_STATE JIS_state_table[JIS_S_NUM][JIS_C_NUM] = {
-/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTH*/
-/*ASCII*/ { A_ESC, ASCII, ASCII, ASCII, ASCII, ASCII, ASCII,ASCII,ASCII},
-/*A_ESC*/ { ASCII, A_ESC_DL,ASCII, ASCII, ASCII, ASCII, ASCII,ASCII,ASCII},
-/*A_ESC_DL*/{ ASCII, ASCII, ASCII, JIS, JIS, ASCII, ASCII,ASCII,ASCII},
-/*JIS*/ { J_ESC, JIS_1, JIS_1, JIS_1, JIS_1, JIS_1, INV, JIS_1,INV },
-/*JIS_1*/ { INV, JIS_2, JIS_2, JIS_2, JIS_2, JIS_2, INV, JIS_2,INV },
-/*JIS_2*/ { J2_ESC,JIS, JIS, JIS, JIS, JIS, INV, JIS, JIS },
-/*J_ESC*/ { INV, INV, J_ESC_BR, INV, INV, INV, INV, INV, INV },
-/*J_ESC_BR*/{ INV, INV, INV, INV, ASCII, ASCII, INV, INV, INV },
-/*J2_ESC*/ { INV, INV, J2_ESC_BR,INV, INV, INV, INV, INV, INV },
-/*J2_ESC_BR*/{INV, INV, INV, INV, ASCII, ASCII, INV, INV, INV },
-};
-
-static const JIS_ACTION JIS_action_table[JIS_S_NUM][JIS_C_NUM] = {
-/* ESCAPE DOLLAR BRACKET AT B J NUL JIS_CHAR OTH */
-/*ASCII */ {NOOP, COPYA, COPYA, COPYA, COPYA, COPYA, EMPTY, COPYA, COPYA},
-/*A_ESC */ {COPYA, NOOP, COPYA, COPYA, COPYA, COPYA, COPYA, COPYA, COPYA},
-/*A_ESC_DL */{COPYA, COPYA, COPYA, MAKE_J, MAKE_J, COPYA, COPYA, COPYA, COPYA},
-/*JIS */ {NOOP, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR},
-/*JIS_1 */ {ERROR, NOOP, NOOP, NOOP, NOOP, NOOP, ERROR, NOOP, ERROR},
-/*JIS_2 */ {NOOP, COPYJ2,COPYJ2,COPYJ2, COPYJ2, COPYJ2,ERROR, COPYJ2,COPYJ2},
-/*J_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR},
-/*J_ESC_BR */{ERROR, ERROR, ERROR, ERROR, NOOP, NOOP, ERROR, ERROR, ERROR},
-/*J2_ESC */ {ERROR, ERROR, NOOP, ERROR, ERROR, ERROR, ERROR, ERROR, ERROR},
-/*J2_ESC_BR*/{ERROR, ERROR, ERROR, ERROR, COPYJ, COPYJ, ERROR, ERROR, ERROR},
-};
-
-
-const char *literal_codeset = NULL;
-
-/* Store into *PWC (if PWC is not null) the wide character
- corresponding to the multibyte character at the start of the
- buffer S of size N. Return the number of bytes in the multibyte
- character. Return -1 if the bytes do not form a valid character,
- or 0 if S is null or points to a null byte.
-
- This function behaves like the Standard C function mbtowc, except
- it treats locale names of the form "C-..." specially. */
-
-int
-local_mbtowc (wchar_t *pwc, const char *s, size_t n)
-{
- static JIS_STATE save_state = ASCII;
- JIS_STATE curr_state = save_state;
- const unsigned char *t = (const unsigned char *) s;
-
- if (s != NULL && n == 0)
- return -1;
-
- if (literal_codeset == NULL || strlen (literal_codeset) <= 1)
- /* This must be the "C" locale or unknown locale -- fall thru */
- ;
- else if (! strcmp (literal_codeset, "C-SJIS"))
- {
- int char1;
- if (s == NULL)
- /* Not state-dependent. */
- return 0;
-
- char1 = *t;
- if (ISSJIS1 (char1))
- {
- int char2 = t[1];
-
- if (n <= 1)
- return -1;
-
- if (ISSJIS2 (char2))
- {
- if (pwc != NULL)
- *pwc = (((wchar_t) *t) << 8) + (wchar_t) (*(t + 1));
- return 2;
- }
-
- return -1;
- }
-
- if (pwc != NULL)
- *pwc = (wchar_t) *t;
-
- if (*t == '\0')
- return 0;
-
- return 1;
- }
- else if (! strcmp (literal_codeset, "C-EUCJP"))
- {
- int char1;
-
- if (s == NULL)
- /* Not state-dependent. */
- return 0;
-
- char1 = *t;
- if (ISEUCJP (char1))
- {
- int char2 = t[1];
-
- if (n <= 1)
- return -1;
-
- if (ISEUCJP (char2))
- {
- if (pwc != NULL)
- *pwc = (((wchar_t) *t) << 8) + (wchar_t) (*(t + 1));
- return 2;
- }
-
- return -1;
- }
-
- if (pwc != NULL)
- *pwc = (wchar_t) *t;
-
- if (*t == '\0')
- return 0;
-
- return 1;
- }
- else if (! strcmp (literal_codeset, "C-JIS"))
- {
- JIS_ACTION action;
- JIS_CHAR_TYPE ch;
- const unsigned char *ptr;
- size_t i, curr_ch;
-
- if (s == NULL)
- {
- save_state = ASCII;
- /* State-dependent. */
- return 1;
- }
-
- ptr = t;
-
- for (i = 0; i < n; i++)
- {
- curr_ch = t[i];
- switch (curr_ch)
- {
- case JIS_ESC_CHAR:
- ch = ESCAPE;
- break;
- case '$':
- ch = DOLLAR;
- break;
- case '@':
- ch = AT;
- break;
- case '(':
- ch = BRACKET;
- break;
- case 'B':
- ch = B;
- break;
- case 'J':
- ch = J;
- break;
- case '\0':
- ch = NUL;
- break;
- default:
- if (ISJIS (curr_ch))
- ch = JIS_CHAR;
- else
- ch = OTHER;
- }
-
- action = JIS_action_table[curr_state][ch];
- curr_state = JIS_state_table[curr_state][ch];
-
- switch (action)
- {
- case NOOP:
- break;
-
- case EMPTY:
- if (pwc != NULL)
- *pwc = (wchar_t) 0;
-
- save_state = curr_state;
- return i;
-
- case COPYA:
- if (pwc != NULL)
- *pwc = (wchar_t) *ptr;
- save_state = curr_state;
- return i + 1;
-
- case COPYJ:
- if (pwc != NULL)
- *pwc = (((wchar_t) *ptr) << 8) + (wchar_t) (*(ptr + 1));
-
- save_state = curr_state;
- return i + 1;
-
- case COPYJ2:
- if (pwc != NULL)
- *pwc = (((wchar_t) *ptr) << 8) + (wchar_t) (*(ptr + 1));
-
- save_state = curr_state;
- return ptr - t + 2;
-
- case MAKE_A:
- case MAKE_J:
- ptr = (const unsigned char *) (t + i + 1);
- break;
-
- case ERROR:
- default:
- return -1;
- }
- }
-
- /* More than n bytes needed. */
- return -1;
- }
-
-#ifdef CROSS_COMPILE
- if (s == NULL)
- /* Not state-dependent. */
- return 0;
-
- if (pwc != NULL)
- *pwc = *s;
- return 1;
-#else
-
- /* This must be the "C" locale or unknown locale. */
- return mbtowc (pwc, s, n);
-#endif
-}
-
-/* Return the number of bytes in the multibyte character at the start
- of the buffer S of size N. Return -1 if the bytes do not form a
- valid character, or 0 if S is null or points to a null byte.
-
- This function behaves like the Standard C function mblen, except
- it treats locale names of the form "C-..." specially. */
-
-int
-local_mblen (const char *s, size_t n)
-{
- return local_mbtowc (NULL, s, n);
-}
-
-/* Return the maximum mumber of bytes in a multibyte character.
-
- This function returns the same value as the Standard C macro MB_CUR_MAX,
- except it treats locale names of the form "C-..." specially. */
-
-int
-local_mb_cur_max (void)
-{
- if (literal_codeset == NULL || strlen (literal_codeset) <= 1)
- ;
- else if (! strcmp (literal_codeset, "C-SJIS"))
- return 2;
- else if (! strcmp (literal_codeset, "C-EUCJP"))
- return 2;
- else if (! strcmp (literal_codeset, "C-JIS"))
- return 8; /* 3 + 2 + 3 */
-
-#ifdef CROSS_COMPILE
- return 1;
-#else
- if (MB_CUR_MAX > 0)
- return MB_CUR_MAX;
-
- return 1; /* default */
-#endif
-}
-#else /* MULTIBYTE_CHARS */
-extern int dummy; /* silence 'ANSI C forbids an empty source file' warning */
-#endif /* MULTIBYTE_CHARS */
diff --git a/gcc/mbchar.h b/gcc/mbchar.h
deleted file mode 100644
index 3846a8cfbbd..00000000000
--- a/gcc/mbchar.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Various declarations for functions found in mbchar.c
- Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
-
-This file is part of GCC.
-
-GCC is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-GCC is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA. */
-
-#ifndef GCC_MBCHAR_H
-#define GCC_MBCHAR_H
-
-#ifdef MULTIBYTE_CHARS
-
-/* Escape character used for JIS encoding */
-#define JIS_ESC_CHAR 0x1b
-
-#define ISSJIS1(c) (((c) >= 0x81 && (c) <= 0x9f) || ((c) >= 0xe0 && (c) <= 0xef))
-#define ISSJIS2(c) (((c) >= 0x40 && (c) <= 0x7e) || ((c) >= 0x80 && (c) <= 0xfc))
-#define ISEUCJP(c) ((c) >= 0xa1 && (c) <= 0xfe)
-#define ISJIS(c) ((c) >= 0x21 && (c) <= 0x7e)
-
-extern int local_mbtowc (wchar_t *, const char *, size_t);
-extern int local_mblen (const char *, size_t);
-extern int local_mb_cur_max (void);
-
-/* The locale being used for multibyte characters in string/char literals. */
-extern const char *literal_codeset;
-#endif /* MULTIBYTE_CHARS */
-#endif /* ! GCC_MBCHAR_H */
diff --git a/gcc/system.h b/gcc/system.h
index 67ddaff5ce3..37d68f5f572 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -607,7 +607,7 @@ typedef char _Bool;
DBX_LBRAC_FIRST DBX_OUTPUT_ENUM DBX_OUTPUT_SOURCE_FILENAME \
DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE \
INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT \
- EXIT_BODY OBJECT_FORMAT_ROSE
+ EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \