From f39941e4127085f2120e40ffefc287f8c4a9548a Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Thu, 2 Oct 2003 22:55:10 +0000 Subject: Update. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2003-08-22 Simon Josefsson * argp/argp-fmtstream.h [!__attribute__]: Define to nothing. * argp/argp-help.c: Don't include malloc.h, some platforms complain and it doesn't appear to be used. [!_LIBC && HAVE_STRERROR_R && !HAVE_DECL_STRERROR_R]: Declare strerror_r. [!_LIBC && !HAVE_STRERROR_R && !HAVE_DECL_STRERROR]: Declare strerror. (hol_entry_long_iterate): Change __attribute to __attribute__. (_help, __argp_error, __argp_failure) [!_LIBC && (HAVE_FLOCKFILE && HAVE_FUNLOCKFILE)]: Protect call to flockfile and funlockfile. (__argp_basename) [!_LIBC]: New. Taken from LSH, by Niels Möller, modifed after comments from Ulrich Drepper. (__argp_short_program_name): Ditto. (__argp_state_help, __argp_error, __argp_failure): Use it. (__argp_failure): Use strerror when necessary. * argp/argp-namefrob.h (__flockfile, __funlockfile, __mempcpy) (__strchrnul, __strerror_r, __strndup) [!_LIBC]: Remove __-prefix. (clearerr_unlocked, feof_unlocked, ferror_unlocked) (fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked) (fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked) (putc_unlocked, putchar_unlocked) [!_LIBC && !HAVE_DECL_*]: Map to non-unlocked functions. [!_LIBC]: Add prototypes for __argp_basename and __argp_short_program_name. * argp/argp-parse.c (argp_default_parser): Only use program_invocation{_short,}_name if declared. (parser_init): Use __argp_short_program_name. * argp/argp-xinl.c [_LIBC || HAVE_FEATURES_H]: Add CPP check for '#include features.h'. * argp/argp.h [!__attribute__]: Define to nothing. --- argp/argp-fmtstream.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'argp/argp-fmtstream.h') diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h index 7a291e28c3..5d0d5eac92 100644 --- a/argp/argp-fmtstream.h +++ b/argp/argp-fmtstream.h @@ -34,6 +34,19 @@ #include #include +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__ +# define __attribute__(Spec) /* empty */ +# endif +/* The __-protected variants of `format' and `printf' attributes + are accepted by gcc versions 2.6.4 (effectively 2.7) and later. */ +# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || __STRICT_ANSI__ +# define __format__ format +# define __printf__ printf +# endif +#endif + #if (_LIBC - 0 && !defined (USE_IN_LIBIO)) \ || (defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)) /* line_wrap_stream is available, so use that. */ -- cgit v1.2.3