[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] gawk-3.1.0 internationalization nit; and make getopt, regex and
From: |
Nix |
Subject: |
[PATCH] gawk-3.1.0 internationalization nit; and make getopt, regex and friends respect ENABLE_NLS |
Date: |
11 Jun 2001 19:48:53 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Developer-Friendly Unix APIs) |
[Disclaimer: this patch was routed via a system running Outlook.
Arbitrarily large amounts of damage may have resulted.]
This fixes a couple of nits in the recently added gawk internationalization
layer:
--- If --enable-nls is not specified, configure does not check for
libintl, where gettext() resides on some systems; yet some files
(regex.c, dfa.c and getopt.c) proceed to call gettext() anyway,
making linking fail; solution is not to call gettext() then.
--- Some systems (at least sparc-sun-solaris2.5.1) include <libintl.h>
from <locale.h>; so if internationalization is off and we have
annulled gettext() and friends already, the allulments of gettext()
and friends kick in and transform the prototypes in <libintl.h>
to nonsense when <locale.h> is included.
Whoever would have thought that turning internationalization *off* would
be so difficult :)
* awk.h (HAVE_LOCALE_H): Move above annullment of gettext.
* dfa.c, getopt.c, regex.c: Only #include <libintl.h> if ENABLE_NLS.
diff -durN gawk-3.1.0-orig/awk.h gawk-3.1.0/awk.h
--- gawk-3.1.0-orig/awk.h Sun Apr 22 14:44:13 2001
+++ gawk-3.1.0/awk.h Mon Jun 11 17:02:18 2001
@@ -49,6 +49,10 @@
#include <ctype.h>
#include <setjmp.h>
+#if defined(HAVE_LOCALE_H)
+#include <locale.h>
+#endif
+
#if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0
#include <libintl.h>
#else /* ! (HAVE_LOCALE_H && defined(ENABLE_NLS) && ENABLE_LS > 0) */
@@ -65,9 +69,6 @@
#define _(msgid) gettext(msgid)
#define N_(msgid) msgid
-#ifdef HAVE_LOCALE_H
-#include <locale.h>
-#endif /* HAVE_LOCALE_H */
#if defined(HAVE_STDARG_H) && defined(__STDC__) && __STDC__
#include <stdarg.h>
#else
diff -durN gawk-3.1.0-orig/dfa.c gawk-3.1.0/dfa.c
--- gawk-3.1.0-orig/dfa.c Mon Apr 9 11:28:39 2001
+++ gawk-3.1.0/dfa.c Mon Jun 11 17:23:32 2001
@@ -94,7 +94,7 @@
/* If we (don't) have I18N. */
/* glibc defines _ */
#ifndef _
-# ifdef HAVE_LIBINTL_H
+# if defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0
# include <libintl.h>
# ifndef _
# define _(Str) gettext (Str)
diff -durN gawk-3.1.0-orig/getopt.c gawk-3.1.0/getopt.c
--- gawk-3.1.0-orig/getopt.c Tue Nov 7 13:24:19 2000
+++ gawk-3.1.0/getopt.c Mon Jun 11 17:14:51 2001
@@ -78,7 +78,7 @@
#ifndef _
/* This is for other GNU distributions with internationalized messages. */
-# if defined HAVE_LIBINTL_H || defined _LIBC
+# if (defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0) ||
defined _LIBC
# include <libintl.h>
# ifndef _
# define _(msgid) gettext (msgid)
diff -durN gawk-3.1.0-orig/regex.c gawk-3.1.0/regex.c
--- gawk-3.1.0-orig/regex.c Tue Feb 6 16:13:53 2001
+++ gawk-3.1.0/regex.c Mon Jun 11 17:16:09 2001
@@ -81,7 +81,7 @@
#endif
/* This is for other GNU distributions with internationalized messages. */
-#if HAVE_LIBINTL_H || defined _LIBC
+#if (defined(HAVE_LIBINTL_H) && defined(ENABLE_NLS) && ENABLE_NLS > 0) ||
defined _LIBC
# include <libintl.h>
#else
# define gettext(msgid) (msgid)
--
`"This code is gross!" meaning "This code has over 144 compilation errors."'
--- Correct use of English, from jer
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] gawk-3.1.0 internationalization nit; and make getopt, regex and friends respect ENABLE_NLS,
Nix <=