summary refs log tree commit diff
path: root/posix/getopt.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-09-30 21:18:30 +0000
committerRoland McGrath <roland@gnu.org>1995-09-30 21:18:30 +0000
commit879bf2e65a9ddaea34fe0428ab0f71caca4b4d00 (patch)
tree7bfc6325a784f1f65f7cd527f1b1be6f2ff1a456 /posix/getopt.c
parent41cfadd63c6d28400f263460e3f2b15e74893b63 (diff)
downloadglibc-879bf2e65a9ddaea34fe0428ab0f71caca4b4d00.tar.gz
glibc-879bf2e65a9ddaea34fe0428ab0f71caca4b4d00.tar.xz
glibc-879bf2e65a9ddaea34fe0428ab0f71caca4b4d00.zip
* sysdeps/mach/hurd/dl-sysdep.c (_dl_sysdep_start): If started by
	kernel with args on stack, point _dl_hurd_data at zero data
	instead of garbage.  When ld.so run as program, grok args
	-LIB=MEMOBJ and pre-load shared object files found in memory
	objects loaded by the boot loader.

	* elf/link.h (struct link_map): New member `l_entry'.
	(_dl_map_object, _dl_map_object_from_fd): Remove last arg ENTRY_POINT.
	* elf/dl-load.c (_dl_map_object, _dl_map_object_from_fd): Remove
	last arg ENTRY_POINT.  Store the entry point location in the
	`l_entry' member of the new map.
	* elf/rtld.c (dl_main): Don't pass USER_ENTRY arg to
	_dl_map_object.  When run as program, set *USER_ENTRY to L->l_entry.
	* elf/dl-init.c (_dl_init_next): Don't pass ENTRY_POINT arg to
	_dl_map_object.
Diffstat (limited to 'posix/getopt.c')
-rw-r--r--posix/getopt.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/posix/getopt.c b/posix/getopt.c
index 85647e2d36..371b6f10f9 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -63,12 +63,15 @@ Cambridge, MA 02139, USA.  */
 #include <stdlib.h>
 #endif	/* GNU C library.  */
 
+#ifndef _
 /* This is for other GNU distributions with internationalized messages.
-   The GNU C Library itself does not yet support such messages.  */
-#if HAVE_LIBINTL_H
+   When compiling libc, the _ macro is predefined.  */
+#ifdef HAVE_LIBINTL_H
 # include <libintl.h>
+# define _(msgid)	gettext (msgid)
 #else
-# define gettext(msgid) (msgid)
+# define _(msgid)	(msgid)
+#endif
 #endif
 
 /* This version of `getopt' appears to the caller like standard Unix `getopt'
@@ -520,7 +523,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
       if (ambig && !exact)
 	{
 	  if (opterr)
-	    fprintf (stderr, gettext ("%s: option `%s' is ambiguous\n"),
+	    fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
 		     argv[0], argv[optind]);
 	  nextchar += strlen (nextchar);
 	  optind++;
@@ -543,12 +546,12 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 		   if (argv[optind - 1][1] == '-')
 		    /* --option */
 		    fprintf (stderr,
-		     gettext ("%s: option `--%s' doesn't allow an argument\n"),
+		     _("%s: option `--%s' doesn't allow an argument\n"),
 		     argv[0], pfound->name);
 		   else
 		    /* +option or -option */
 		    fprintf (stderr,
-		     gettext ("%s: option `%c%s' doesn't allow an argument\n"),
+		     _("%s: option `%c%s' doesn't allow an argument\n"),
 		     argv[0], argv[optind - 1][0], pfound->name);
 
 		  nextchar += strlen (nextchar);
@@ -563,7 +566,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 		{
 		  if (opterr)
 		    fprintf (stderr,
-			   gettext ("%s: option `%s' requires an argument\n"),
+			   _("%s: option `%s' requires an argument\n"),
 			   argv[0], argv[optind - 1]);
 		  nextchar += strlen (nextchar);
 		  return optstring[0] == ':' ? ':' : '?';
@@ -591,11 +594,11 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 	    {
 	      if (argv[optind][1] == '-')
 		/* --option */
-		fprintf (stderr, gettext ("%s: unrecognized option `--%s'\n"),
+		fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
 			 argv[0], nextchar);
 	      else
 		/* +option or -option */
-		fprintf (stderr, gettext ("%s: unrecognized option `%c%s'\n"),
+		fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
 			 argv[0], argv[optind][0], nextchar);
 	    }
 	  nextchar = (char *) "";
@@ -620,10 +623,10 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 	  {
 	    if (posixly_correct)
 	      /* 1003.2 specifies the format of this message.  */
-	      fprintf (stderr, gettext ("%s: illegal option -- %c\n"),
+	      fprintf (stderr, _("%s: illegal option -- %c\n"),
 		       argv[0], c);
 	    else
-	      fprintf (stderr, gettext ("%s: invalid option -- %c\n"),
+	      fprintf (stderr, _("%s: invalid option -- %c\n"),
 		       argv[0], c);
 	  }
 	optopt = c;
@@ -659,7 +662,7 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
 		  {
 		    /* 1003.2 specifies the format of this message.  */
 		    fprintf (stderr,
-			   gettext ("%s: option requires an argument -- %c\n"),
+			   _("%s: option requires an argument -- %c\n"),
 			   argv[0], c);
 		  }
 		optopt = c;