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 63c9751..a3471c3 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 005be88..2293f67 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 0c78b6e..90606f2 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 c02abce..db97393 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 289d137..9917d9a 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 a9ccf38..2367137 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 e36685f..43df859 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 bebd245..fbe3f6a 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 0244da3..0ef6c91 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 9d43956..2dc9b1c 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 7d7a979..4cb4703 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 0988f07..02c2abd 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 0e2807a..b32e3da 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 049b9af..2e7ffc9 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 1d3df6e..9def456 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 4d4facf..57bf124 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 2f103d6..df95ecd 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 0e35cb6..7fe06b8 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"