From c5af724c0b214a517f8558887f7a70efcfa2c813 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 29 Nov 2003 07:20:47 +0000 Subject: Update. 2003-10-10 Simon Josefsson * argp/argp-namefrob.h [!_LIBC]: Include mempcpy.h, strcase.h, strchrnul.h, strndup.h (from gnulib). * argp/argp-parse.c: Add alloca.h include snippet verbatim from Autoconf manual. * argp/argp-help.c: Replace alloca.h include snipper with verbatim Autoconf manual version. * argp/argp.h: Map __restrict to restrict or empty string when necessary, copied verbatim from posix/regex.h. --- argp/argp-help.c | 18 +++++++----------- argp/argp-namefrob.h | 5 +++++ argp/argp-parse.c | 17 ++++++++++++++++- argp/argp.h | 12 ++++++++++++ 4 files changed, 40 insertions(+), 12 deletions(-) (limited to 'argp') diff --git a/argp/argp-help.c b/argp/argp-help.c index 1365abcea6..b7e088ef10 100644 --- a/argp/argp-help.c +++ b/argp/argp-help.c @@ -26,20 +26,16 @@ #include #endif -#ifndef alloca -# ifdef __GNUC__ -# define alloca __builtin_alloca -# define HAVE_ALLOCA 1 +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H || defined _LIBC +# include # else -# if defined HAVE_ALLOCA_H || defined _LIBC -# include +# ifdef _AIX +#pragma alloca # else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca +# ifndef alloca /* predefined by HP cc +Olibcalls */ char *alloca (); -# endif # endif # endif # endif diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h index 26e285bfba..6924df7ddc 100644 --- a/argp/argp-namefrob.h +++ b/argp/argp-namefrob.h @@ -77,6 +77,11 @@ #undef __argp_fmtstream_wmargin #define __argp_fmtstream_wmargin argp_fmtstream_wmargin +#include "mempcpy.h" +#include "strcase.h" +#include "strchrnul.h" +#include "strndup.h" + /* normal libc functions we call */ #undef __flockfile #define __flockfile flockfile diff --git a/argp/argp-parse.c b/argp/argp-parse.c index 0b619db0f3..47223dc597 100644 --- a/argp/argp-parse.c +++ b/argp/argp-parse.c @@ -1,5 +1,5 @@ /* Hierarchial argument parsing, layered over getopt - Copyright (C) 1995-2000, 2002 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2002, 2003 Free Software Foundation, Inc. This file is part of the GNU C Library. Written by Miles Bader . @@ -22,6 +22,21 @@ #include #endif +/* AIX requires this to be the first thing in the file. */ +#ifndef __GNUC__ +# if HAVE_ALLOCA_H || defined _LIBC +# include +# else +# ifdef _AIX +#pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +#endif + #include #include #include diff --git a/argp/argp.h b/argp/argp.h index cb2f85aee7..78a9d1bb3c 100644 --- a/argp/argp.h +++ b/argp/argp.h @@ -49,6 +49,18 @@ # endif #endif +/* GCC 2.95 and later have "__restrict"; C99 compilers have + "restrict", and "configure" may have defined "restrict". */ +#ifndef __restrict +# if ! (2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)) +# if defined restrict || 199901L <= __STDC_VERSION__ +# define __restrict restrict +# else +# define __restrict +# endif +# endif +#endif + #ifndef __error_t_defined typedef int error_t; # define __error_t_defined -- cgit v1.2.3-65-gdbad