Include gettext.h instead of <libintl.h> with #ifdefs.
authorBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2002 21:45:29 +0000 (21:45 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 5 Nov 2002 21:45:29 +0000 (21:45 +0000)
18 files changed:
lib/ChangeLog
lib/argmatch.c
lib/closeout.c
lib/error.c
lib/getopt.c
lib/human.c
lib/long-options.c
lib/makepath.c
lib/obstack.c
lib/quotearg.c
lib/regex.c
lib/rpmatch.c
lib/same.c
lib/unicodeio.c
lib/userspec.c
lib/version-etc.c
lib/xmalloc.c
lib/xmemcoll.c

index 63c9751e8113839e1282074b5ba107f2f2cf22a5..a3471c3fd25fce841a96b043fc4dcd87e8394268 100644 (file)
@@ -1,3 +1,27 @@
+2002-11-05  Bruno Haible  <bruno@clisp.org>
+
+       * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
+       * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
+       * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
+       * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
+
+       * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
+       * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
+
+       * closeout.c: Include gettext.h instead of <libintl.h>.
+       * human.c: Include gettext.h instead of <libintl.h>.
+       * quotearg.c: Include gettext.h instead of <libintl.h>.
+       * rpmatch.c: Include gettext.h instead of <libintl.h>.
+       * unicodeio.c: Include gettext.h instead of <libintl.h>.
+       * userspec.c: Include gettext.h instead of <libintl.h>.
+       * version-etc.c: Include gettext.h instead of <libintl.h>.
+       * xmalloc.c: Include gettext.h instead of <libintl.h>.
+       (textdomain): Remove definition.
+       * xmemcoll.c: Include gettext.h instead of <libintl.h>.
+
+       * long-options.c: Remove include of <libintl.h> and definition of _.
+       * same.c: Remove include of <libintl.h> and definition of _.
+
 2002-11-04  Bruno Haible  <bruno@clisp.org>
 
        * stpcpy.h: New file, from GNU gettext-0.11.5.
index 005be881f21b4c0aa67c958b9bd82e2a2c28ec70..2293f67cc080addca92c2d55255e03386116b03e 100644 (file)
@@ -1,5 +1,5 @@
 /* argmatch.c -- find a match for a string in an array
-   Copyright (C) 1990, 1998, 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 # include <string.h>
 #endif
 
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 
 #include "error.h"
 #include "quotearg.h"
index 0c78b6e4c3e0fd9b9a4a0a976542bc5c8f838fbe..90606f246da85fd27033f8395edb051e2f0f4e90 100644 (file)
@@ -1,5 +1,5 @@
 /* closeout.c - close standard output
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 # include <config.h>
 #endif
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
-
 #if HAVE_STDLIB_H
 # include <stdlib.h>
 #endif
@@ -40,6 +33,9 @@
 extern int errno;
 #endif
 
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
 #include "closeout.h"
 #include "error.h"
 #include "quotearg.h"
index c02abcee8a65752fb4de153accd9d08a0c063418..db97393d0504db5462ccfb8cd8c76cfd941609d6 100644 (file)
 #endif
 
 #include <stdio.h>
-#if HAVE_LIBINTL_H
+
+#ifdef _LIBC
 # include <libintl.h>
+#else
+# include "gettext.h"
 #endif
+#define _(msgid) gettext (msgid)
+
 #ifdef _LIBC
 # include <wchar.h>
 # define mbsrtowcs __mbsrtowcs
@@ -56,10 +61,6 @@ void exit ();
 #include "error.h"
 #include "unlocked-io.h"
 
-#ifndef _
-# define _(String) String
-#endif
-
 /* If NULL, error will flush stdout, then print on stderr the program
    name, a colon and a space.  Otherwise, error will call this
    function without parameters instead.  */
index 289d137e20babf967f75a5baa19c904b2ff5b68a..9917d9a640a34e7a2e67451fa4e9d69ea7bdccb8 100644 (file)
 # endif
 #endif
 
-#ifndef _
+#ifdef _LIBC
+# include <libintl.h>
+#else
 /* This is for other GNU distributions with internationalized messages.  */
-# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
-#  include <libintl.h>
-#  ifndef _
-#   define _(msgid)    gettext (msgid)
-#  endif
-# else
-#  define _(msgid)     (msgid)
-# endif
-# if defined _LIBC && defined USE_IN_LIBIO
-#  include <wchar.h>
-# endif
+# include "gettext.h"
+#endif
+#define _(msgid) gettext (msgid)
+
+#if defined _LIBC && defined USE_IN_LIBIO
+# include <wchar.h>
 #endif
 
 #ifndef attribute_hidden
index a9ccf38c48312e5270889101283f65c35672afb5..2367137e007b842919de2decfa04fa94f2b2ac1d 100644 (file)
@@ -1,6 +1,6 @@
 /* human.c -- print human readable file size
 
-   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software
+   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
 char *getenv ();
 #endif
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 
 #include <argmatch.h>
 #include <error.h>
index e36685fb01a6d71f23a8995da3bb13d1729fd245..43df8594e3a95cd538d062919aa0c34f477ba669 100644 (file)
@@ -1,5 +1,5 @@
 /* Utility to accept --help and --version options as unobtrusively as possible.
-   Copyright (C) 1993, 1994, 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1993-1994, 1998-1999, 2000, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include "long-options.h"
 #include "version-etc.h"
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
-
 static struct option const long_options[] =
 {
   {"help", no_argument, 0, 'h'},
index bebd245cdf0ce46f25bdd0d96418ec3882beae5a..fbe3f6a65e1f25ac24197e471306afe9bc70d855 100644 (file)
@@ -103,16 +103,8 @@ extern int errno;
 /* Include this before libintl.h so we get our definition of PARAMS. */
 #include "makepath.h"
 
-#if HAVE_LOCALE_H
-# include <locale.h>
-#endif
-
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 
 #include "save-cwd.h"
 #include "dirname.h"
index 0244da3839954d5af8381cb945d5060ca0b4c08f..0ef6c912f088c0f3a0d659dde88882f9e9afee46 100644 (file)
@@ -1,5 +1,5 @@
 /* obstack.c - subroutines used implicitly by object stack macros
-   Copyright (C) 1988-1994,96,97,98,99,2000,2001 Free Software Foundation, Inc.
+   Copyright (C) 1988-1994, 1996-1999, 2000-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 
@@ -458,16 +458,13 @@ _obstack_memory_used (h)
 }
 \f
 /* Define the error handler.  */
-# ifndef _
-#  if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
-#   include <libintl.h>
-#   ifndef _
-#    define _(Str) gettext (Str)
-#   endif
-#  else
-#   define _(Str) (Str)
-#  endif
+# ifdef _LIBC
+#  include <libintl.h>
+# else
+#  include "gettext.h"
 # endif
+# define _(msgid) gettext (msgid)
+
 # if defined _LIBC && defined USE_IN_LIBIO
 #  include <libio/iolibio.h>
 #  define fputs(s, f) _IO_fputs (s, f)
index 9d4395659803c07ded501077e1cacc3f28589ccc..2dc9b1c47383bed9789f8c6f706914317b797daa 100644 (file)
 
 #include <ctype.h>
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(text) gettext (text)
-#else
-# define _(text) text
-#endif
-#define N_(text) text
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
 
 #if HAVE_LIMITS_H
 # include <limits.h>
index 7d7a9793ed77d17e2ff3037bbf4c6dfb1ace260b..4cb470305b513aad19d3df975040d4e71f8f7d9c 100644 (file)
@@ -2,7 +2,7 @@
    version 0.12.
    (Implements POSIX draft P1003.2/D11.2, except for some of the
    internationalization features.)
-   Copyright (C) 1993-1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1993-1999, 2000-2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
 #  include <locale/coll-lookup.h>
 # endif
 
-/* This is for other GNU distributions with internationalized messages.  */
-# if (HAVE_LIBINTL_H && ENABLE_NLS) || defined _LIBC
+# ifdef _LIBC
 #  include <libintl.h>
-#  ifdef _LIBC
-#   undef gettext
-#   define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
-#  endif
+#  undef gettext
+#  define gettext(msgid) __dcgettext ("libc", msgid, LC_MESSAGES)
+   /* This define is so xgettext can find the internationalizable strings.  */
+#  define gettext_noop(msgid) msgid
 # else
-#  define gettext(msgid) (msgid)
-# endif
-
-# ifndef gettext_noop
-/* This define is so xgettext can find the internationalizable
-   strings.  */
-#  define gettext_noop(String) String
+/* This is for other GNU distributions with internationalized messages.  */
+#  include "gettext.h"
 # endif
 
 /* Support for bounded pointers.  */
index 0988f07d04445404b33b340fd57e577679406deb..02c2abdb884237bd9e5475f1be79512367340f8c 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether string value is affirmation or negative response
    according to current locale's data.
-   Copyright (C) 1996, 1998, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1996, 1998, 2000, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -35,8 +35,8 @@
 #  include <limits.h>
 # endif
 # include <regex.h>
-# include <libintl.h>
-# define _(Text) gettext (Text)
+# include "gettext.h"
+# define _(msgid) gettext (msgid)
 
 static int
 try (const char *response, const char *pattern, const int match,
index 0e2807ac200d86e1a8daed8265ebc45fcc2ff62f..b32e3dab9faef04e6182c1d2847c315a7a2727a4 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine whether two file names refer to the same file.
-   Copyright (C) 1997-2000 Free Software Foundation, Inc.
+   Copyright (C) 1997-2000, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -47,13 +47,6 @@ extern int errno;
 #include "error.h"
 #include "xalloc.h"
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
-
 #ifndef HAVE_DECL_FREE
 "this configure-time declaration test was not run"
 #endif
index 049b9afd0ae87039fe9dfa0fa3b44a7dc09eef15..2e7ffc9d0eedd1c7fdaefc1777d85dd3d64170ce 100644 (file)
@@ -20,7 +20,7 @@
 /* Written by Bruno Haible <haible@clisp.cons.org>.  */
 
 /* Note: This file requires the locale_charset() function.  See in
-   libiconv-1.7/libcharset/INTEGRATE for how to obtain it.  */
+   libiconv-1.8/libcharset/INTEGRATE for how to obtain it.  */
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -48,13 +48,9 @@ extern int errno;
 
 #include <error.h>
 
-#if ENABLE_NLS
-# include <libintl.h>
-#else
-# define gettext(Text) Text
-#endif
-#define _(Text) gettext (Text)
-#define N_(Text) Text
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
 
 /* Specification.  */
 #include "unicodeio.h"
index 1d3df6e442c60d5e62682a43819fe520c64866d2..9def456adb7f20b17a6a3bcb64f463c81b77412c 100644 (file)
@@ -68,13 +68,9 @@ char *alloca ();
 #include "xalloc.h"
 #include "xstrtol.h"
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
-#define N_(Text) Text
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
 
 #ifndef _POSIX_VERSION
 struct passwd *getpwnam ();
index 4d4facf0c2b68e1fee8127cae61cebfd1d4ec66d..57bf1248cb87bcc1e4ee615050de1a0e7ba500b2 100644 (file)
 #include "unlocked-io.h"
 #include "version-etc.h"
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 
 /* Default copyright goes to the FSF. */
 
index 2f103d6049178e6fa69879d91032c08c2bb3dc2c..df95ecdf6be137abe18de118bce9d1eb578ca255 100644 (file)
@@ -1,5 +1,5 @@
 /* xmalloc.c -- malloc with out of memory checking
-   Copyright (C) 1990-1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1990-1999, 2000, 2002 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,14 +30,9 @@ void *realloc ();
 void free ();
 #endif
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define textdomain(Domain)
-# define _(Text) Text
-#endif
-#define N_(Text) Text
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+#define N_(msgid) msgid
 
 #include "error.h"
 #include "xalloc.h"
index 0e35cb677d583258b1e51772a11a324ffff6d56a..7fe06b8cb3dc94f610819e7c59578836e58ada6c 100644 (file)
@@ -28,12 +28,8 @@ extern int errno;
 
 #include <stdlib.h>
 
-#if ENABLE_NLS
-# include <libintl.h>
-# define _(Text) gettext (Text)
-#else
-# define _(Text) Text
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
 
 #include "error.h"
 #include "memcoll.h"