re PR java/5080 (gcc/java/jcf-parse.c:908: `LC_CTYPE' undeclared (first use in this...
authorCraig Rodrigues <rodrigc@gcc.gnu.org>
Fri, 1 Feb 2002 21:07:31 +0000 (21:07 +0000)
committerCraig Rodrigues <rodrigc@gcc.gnu.org>
Fri, 1 Feb 2002 21:07:31 +0000 (21:07 +0000)
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

gcc/java/ChangeLog
gcc/java/jcf-parse.c
gcc/java/jv-scan.c

index a4fec0936cbf6c632642ba0c8879cc749bae560e..f80ca1ed1447c2fbfde65737c84743593b1e8b8b 100644 (file)
@@ -1,3 +1,10 @@
+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.
+
 2002-01-31  Joseph S. Myers  <jsm28@cam.ac.uk>
 
        * gjavah.c (version), jcf-dump.c (version), jv-scan.c (version):
index ff5bf05f6df3283cfbd0d90577d83f76d0d01908..3e3bd23650771f3a7f762b755bda80987bf882b7 100644 (file)
@@ -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;
 
index 343655e5c90c99f770032878920c34f9a09429ad..2f7c3b9a6dbecf78b7955de81b2000536cd7f5e6 100644 (file)
@@ -199,13 +199,11 @@ DEFUN (main, (argc, argv),
            /* 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 (encoding == NULL)
              encoding = nl_langinfo (CODESET);
-#endif /* HAVE_NL_LANGINFO */
-#endif /* HAVE_ICONV */
+#endif  
            if (encoding == NULL || *encoding == '\0')
              encoding = DEFAULT_ENCODING;