summaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorCraig Rodrigues <rodrigc@gcc.gnu.org>2002-02-01 21:07:31 +0000
committerCraig Rodrigues <rodrigc@gcc.gnu.org>2002-02-01 21:07:31 +0000
commit58fae3f7aee5e36101ccc5818872462a72ba01c9 (patch)
tree9237fa455523e9004465ee3b4cf2af0fadc1ea0b /gcc/java/jcf-parse.c
parent3a441e3884882e1a6565773f56b08b8caf97009c (diff)
downloadgcc-58fae3f7aee5e36101ccc5818872462a72ba01c9.tar.gz
re PR java/5080 (gcc/java/jcf-parse.c:908: `LC_CTYPE' undeclared (first use in this function))
2002-02-01 Craig Rodrigues <rodrigc@gcc.gnu.org> PR java/5080 * jcf-parse.c : Check for HAVE_LOCALE_H before using setlocale() with LC_CTYPE as a parameter. * jv-scan.c: Same. From-SVN: r49410
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index ff5bf05f6df..3e3bd236507 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -911,13 +911,11 @@ parse_source_file_1 (file, finput)
/* There's no point in trying to find the current encoding unless we
are going to do something intelligent with it -- hence the test
for iconv. */
-#ifdef HAVE_ICONV
-#ifdef HAVE_NL_LANGINFO
+#if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_NL_LANGINFO)
setlocale (LC_CTYPE, "");
if (current_encoding == NULL)
current_encoding = nl_langinfo (CODESET);
-#endif /* HAVE_NL_LANGINFO */
-#endif /* HAVE_ICONV */
+#endif
if (current_encoding == NULL || *current_encoding == '\0')
current_encoding = DEFAULT_ENCODING;