1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-05 19:35:52 +03:00

2003-10-02 Roland McGrath <roland@redhat.com>

* argp/argp-help.c (__argp_short_program_name): Move inside [! _LIBC].
	* argp/argp-namefrob.h
	[_LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME]
	(__argp_short_program_name): Don't declare fn, define it as a macro.
This commit is contained in:
Roland McGrath
2003-10-03 00:44:39 +00:00
parent f39941e412
commit d6e68295b4
2 changed files with 16 additions and 11 deletions

View File

@@ -1696,12 +1696,11 @@ char *__argp_basename (char *name)
char *short_name = strrchr (name, '/'); char *short_name = strrchr (name, '/');
return short_name ? short_name + 1 : name; return short_name ? short_name + 1 : name;
} }
#endif
char * char *
__argp_short_program_name (void) __argp_short_program_name (void)
{ {
#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME # if HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
return program_invocation_short_name; return program_invocation_short_name;
# elif HAVE_DECL_PROGRAM_INVOCATION_NAME # elif HAVE_DECL_PROGRAM_INVOCATION_NAME
return __argp_basename (program_invocation_name); return __argp_basename (program_invocation_name);
@@ -1715,6 +1714,7 @@ __argp_short_program_name (void)
return ""; return "";
# endif # endif
} }
#endif
/* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are /* Output, if appropriate, a usage message for STATE to STREAM. FLAGS are
from the set ARGP_HELP_*. */ from the set ARGP_HELP_*. */

View File

@@ -1,5 +1,5 @@
/* Name frobnication for compiling argp outside of glibc /* Name frobnication for compiling argp outside of glibc
Copyright (C) 1997 Free Software Foundation, Inc. Copyright (C) 1997, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>. Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -138,10 +138,15 @@
# endif # endif
extern char *__argp_basename (char *name); extern char *__argp_basename (char *name);
extern char *__argp_short_program_name (void);
#endif /* !_LIBC */ #endif /* !_LIBC */
#ifndef __set_errno #ifndef __set_errno
#define __set_errno(e) (errno = (e)) #define __set_errno(e) (errno = (e))
#endif #endif
#if defined _LIBC || HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
# define __argp_short_program_name() (program_invocation_short_name)
#else
extern char *__argp_short_program_name (void);
#endif