changeset 5188:e338f602ca07

Use "gettext.h" instead of its complicated substitute. (N_): Define unconditionally. (argp_default_options): Fill out initializers with 0 to avoid gcc warnings.
author Paul Eggert <eggert@cs.ucla.edu>
date Thu, 12 Aug 2004 07:57:52 +0000
parents 5cb548b39529
children 3a1cc3d4726e
files lib/argp-parse.c
diffstat 1 files changed, 13 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lib/argp-parse.c
+++ b/lib/argp-parse.c
@@ -29,24 +29,15 @@
 #include <getopt.h>
 #include <getopt_int.h>
 
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
-   When compiling libc, the _ macro is predefined.  */
-# if defined HAVE_LIBINTL_H || defined _LIBC
-#  include <libintl.h>
-#  ifdef _LIBC
-#   undef dgettext
-#   define dgettext(domain, msgid) \
-  INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
-#  endif
-# else
-#  define dgettext(domain, msgid) (msgid)
-#  define gettext(msgid) (msgid)
-# endif
+#ifdef _LIBC
+# include <libintl.h>
+# undef dgettext
+# define dgettext(domain, msgid) \
+   INTUSE(__dcgettext) (domain, msgid, LC_MESSAGES)
+#else
+# include "gettext.h"
 #endif
-#ifndef N_
-# define N_(msgid) (msgid)
-#endif
+#define N_(msgid) (msgid)
 
 #include "argp.h"
 #include "argp-namefrob.h"
@@ -85,11 +76,11 @@
 static const struct argp_option argp_default_options[] =
 {
   {"help",	  '?',    	0, 0,  N_("Give this help list"), -1},
-  {"usage",	  OPT_USAGE,	0, 0,  N_("Give a short usage message")},
-  {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name")},
+  {"usage",	  OPT_USAGE,	0, 0,  N_("Give a short usage message"), 0},
+  {"program-name",OPT_PROGNAME,"NAME", OPTION_HIDDEN, N_("Set the program name"), 0},
   {"HANG",	  OPT_HANG,    "SECS", OPTION_ARG_OPTIONAL | OPTION_HIDDEN,
-     N_("Hang for SECS seconds (default 3600)")},
-  {0, 0}
+     N_("Hang for SECS seconds (default 3600)"), 0},
+  {NULL, 0, 0, 0, NULL, 0}
 };
 
 static error_t
@@ -150,7 +141,7 @@
 static const struct argp_option argp_version_options[] =
 {
   {"version",	  'V',    	0, 0,  N_("Print program version"), -1},
-  {0, 0}
+  {NULL, 0, 0, 0, NULL, 0}
 };
 
 static error_t