This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[patch] Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
- From: Adrian Bunk <bunk at fs dot tum dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Thu, 21 Feb 2002 01:20:25 +0100 (CET)
- Subject: [patch] Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
Hi,
while playing with trying to compile gjc under NetBSD I found the
following problem: NetBSD has a /usr/include/langinfo.h but this file
doesn't define CODESET. The gcc configure script does already check for
CODESET and therefore the patch below seems to be enough to fix it.
Could someone please review it?
TIA
Adrian
* jcf-parse.c, jv-scan.c: Use HAVE_LANGINFO_CODESET instead of
HAVE_NL_LANGINFO.
--- gcc/java/jcf-parse.c.old Mon Feb 11 20:03:44 2002
+++ gcc/java/jcf-parse.c Mon Feb 11 20:04:42 2002
@@ -43,7 +43,7 @@
#include <locale.h>
#endif
-#ifdef HAVE_NL_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
@@ -916,7 +916,7 @@
/* 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. */
-#if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_NL_LANGINFO)
+#if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_LANGINFO_CODESET)
setlocale (LC_CTYPE, "");
if (current_encoding == NULL)
current_encoding = nl_langinfo (CODESET);
--- gcc/java/jv-scan.c.old Mon Feb 11 20:26:52 2002
+++ gcc/java/jv-scan.c Mon Feb 11 20:27:41 2002
@@ -30,7 +30,7 @@
#include <locale.h>
#endif
-#ifdef HAVE_NL_LANGINFO
+#ifdef HAVE_LANGINFO_CODESET
#include <langinfo.h>
#endif
@@ -199,7 +199,7 @@
/* 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. */
-#if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_NL_LANGINFO)
+#if defined (HAVE_LOCALE_H) && defined (HAVE_ICONV) && defined (HAVE_LANGINFO_CODESET)
setlocale (LC_CTYPE, "");
if (encoding == NULL)
encoding = nl_langinfo (CODESET);