[patch] Use HAVE_LANGINFO_CODESET instead of HAVE_NL_LANGINFO
Adrian Bunk
bunk@fs.tum.de
Wed Feb 20 19:48:00 GMT 2002
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);
More information about the Java-patches
mailing list