summaryrefslogtreecommitdiff
path: root/argp
diff options
context:
space:
mode:
Diffstat (limited to 'argp')
-rw-r--r--argp/Makefile8
-rw-r--r--argp/argp-ba.c2
-rw-r--r--argp/argp-eexst.c2
-rw-r--r--argp/argp-fmtstream.c4
-rw-r--r--argp/argp-fmtstream.h21
-rw-r--r--argp/argp-fs-xinl.c4
-rw-r--r--argp/argp-help.c6
-rw-r--r--argp/argp-namefrob.h2
-rw-r--r--argp/argp-parse.c4
-rw-r--r--argp/argp-pv.c2
-rw-r--r--argp/argp-pvh.c2
-rw-r--r--argp/argp-test.c2
-rw-r--r--argp/argp-xinl.c4
-rw-r--r--argp/argp.h56
-rw-r--r--argp/tst-argp1.c2
-rw-r--r--argp/tst-argp2.c2
16 files changed, 37 insertions, 86 deletions
diff --git a/argp/Makefile b/argp/Makefile
index 6e78c968e9..6e4799c220 100644
--- a/argp/Makefile
+++ b/argp/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1997-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2018 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
# The GNU C Library is free software; you can redistribute it and/or
@@ -28,9 +28,9 @@ routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
tests = argp-test tst-argp1 bug-argp1 tst-argp2 bug-argp2
-CFLAGS-argp-help.c = $(uses-callbacks) -fexceptions
-CFLAGS-argp-parse.c = $(uses-callbacks)
-CFLAGS-argp-fmtstream.c = -fexceptions
+CFLAGS-argp-help.c += $(uses-callbacks) -fexceptions
+CFLAGS-argp-parse.c += $(uses-callbacks)
+CFLAGS-argp-fmtstream.c += -fexceptions
bug-argp1-ARGS = -- --help
bug-argp2-ARGS = -- -d 111 --dstaddr 222 -p 333 --peer 444
diff --git a/argp/argp-ba.c b/argp/argp-ba.c
index 6405e9b64f..a831e078ef 100644
--- a/argp/argp-ba.c
+++ b/argp/argp-ba.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_BUG_ADDRESS.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-eexst.c b/argp/argp-eexst.c
index 4ebf4b77dd..aed3fcf04f 100644
--- a/argp/argp-eexst.c
+++ b/argp/argp-eexst.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_ERR_EXIT_STATUS
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
index d951a962e3..e43a0c7cf1 100644
--- a/argp/argp-fmtstream.c
+++ b/argp/argp-fmtstream.c
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -30,7 +30,7 @@
#include <stdarg.h>
#include <ctype.h>
-#include "argp-fmtstream.h"
+#include <argp-fmtstream.h>
#include "argp-namefrob.h"
#ifndef ARGP_FMTSTREAM_USE_LINEWRAP
diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
index bdeaa54dc2..dcedc21da0 100644
--- a/argp/argp-fmtstream.h
+++ b/argp/argp-fmtstream.h
@@ -1,5 +1,5 @@
/* Word-wrapping and line-truncating streams.
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -29,21 +29,6 @@
#include <string.h>
#include <unistd.h>
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
- defined __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) || \
- defined __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# endif
-#endif
-
#if defined (__GNU_LIBRARY__) && defined (HAVE_LINEWRAP_H)
/* line_wrap_stream is available, so use that. */
#define ARGP_FMTSTREAM_USE_LINEWRAP
@@ -111,6 +96,8 @@ struct argp_fmtstream
typedef struct argp_fmtstream *argp_fmtstream_t;
+__BEGIN_DECLS
+
/* Return an argp_fmtstream that outputs to STREAM, and which prefixes lines
written on it with LMARGIN spaces and limits them to RMARGIN columns
total. If WMARGIN >= 0, words that extend past RMARGIN are wrapped by
@@ -297,6 +284,8 @@ __argp_fmtstream_point (argp_fmtstream_t __fs)
#endif /* __OPTIMIZE__ */
+__END_DECLS
+
#endif /* ARGP_FMTSTREAM_USE_LINEWRAP */
#endif /* argp-fmtstream.h */
diff --git a/argp/argp-fs-xinl.c b/argp/argp-fs-xinl.c
index a7372ae8d8..cceb1c349a 100644
--- a/argp/argp-fs-xinl.c
+++ b/argp/argp-fs-xinl.c
@@ -1,5 +1,5 @@
/* Real definitions for extern inline functions in argp-fmtstream.h
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -24,7 +24,7 @@
#define ARGP_FS_EI
#undef __OPTIMIZE__
#define __OPTIMIZE__ 1
-#include "argp-fmtstream.h"
+#include <argp-fmtstream.h>
#if 0
/* Not exported. */
diff --git a/argp/argp-help.c b/argp/argp-help.c
index dbfaa6ada6..2b6b0775d6 100644
--- a/argp/argp-help.c
+++ b/argp/argp-help.c
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing help output
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -79,8 +79,8 @@ char *strerror (int errnum);
# endif
#endif
-#include "argp.h"
-#include "argp-fmtstream.h"
+#include <argp.h>
+#include <argp-fmtstream.h>
#include "argp-namefrob.h"
#ifndef SIZE_MAX
diff --git a/argp/argp-namefrob.h b/argp/argp-namefrob.h
index 94ee94912a..5588fe172a 100644
--- a/argp/argp-namefrob.h
+++ b/argp/argp-namefrob.h
@@ -1,5 +1,5 @@
/* Name frobnication for compiling argp outside of glibc
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-parse.c b/argp/argp-parse.c
index cd7b46fa64..36fadcfa32 100644
--- a/argp/argp-parse.c
+++ b/argp/argp-parse.c
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing, layered over getopt
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -62,7 +62,7 @@ char *alloca ();
# define N_(msgid) (msgid)
#endif
-#include "argp.h"
+#include <argp.h>
#include "argp-namefrob.h"
/* Getopt return values. */
diff --git a/argp/argp-pv.c b/argp/argp-pv.c
index a1a0db79ce..49dc3b5e28 100644
--- a/argp/argp-pv.c
+++ b/argp/argp-pv.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_VERSION.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-pvh.c b/argp/argp-pvh.c
index 800bdc7994..8c166ad9be 100644
--- a/argp/argp-pvh.c
+++ b/argp/argp-pvh.c
@@ -1,5 +1,5 @@
/* Default definition for ARGP_PROGRAM_VERSION_HOOK.
- Copyright (C) 1996-2016 Free Software Foundation, Inc.
+ Copyright (C) 1996-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-test.c b/argp/argp-test.c
index d7a64b2513..87256235b3 100644
--- a/argp/argp-test.c
+++ b/argp/argp-test.c
@@ -1,5 +1,5 @@
/* Test program for argp argument parser
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
diff --git a/argp/argp-xinl.c b/argp/argp-xinl.c
index 2ffdd04cae..14b8e3866b 100644
--- a/argp/argp-xinl.c
+++ b/argp/argp-xinl.c
@@ -1,5 +1,5 @@
/* Real definitions for extern inline functions in argp.h
- Copyright (C) 1997-2016 Free Software Foundation, Inc.
+ Copyright (C) 1997-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -31,7 +31,7 @@
#define ARGP_EI
#undef __OPTIMIZE__
#define __OPTIMIZE__ 1
-#include "argp.h"
+#include <argp.h>
/* Add weak aliases. */
#if _LIBC - 0 && defined (weak_alias)
diff --git a/argp/argp.h b/argp/argp.h
index e67bbef739..0f2583340f 100644
--- a/argp/argp.h
+++ b/argp/argp.h
@@ -1,5 +1,5 @@
/* Hierarchial argument parsing, layered over getopt.
- Copyright (C) 1995-2016 Free Software Foundation, Inc.
+ Copyright (C) 1995-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Written by Miles Bader <miles@gnu.ai.mit.edu>.
@@ -24,51 +24,15 @@
#include <ctype.h>
#include <getopt.h>
#include <limits.h>
-
-#define __need_error_t
#include <errno.h>
+
+__BEGIN_DECLS
-#ifndef __THROW
-# define __THROW
-#endif
-#ifndef __NTH
-# define __NTH(fct) fct __THROW
-#endif
-
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || \
- defined __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) || \
- defined __STRICT_ANSI__
-# define __format__ format
-# define __printf__ printf
-# 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
-
+/* error_t may or may not be available from errno.h, depending on the
+ operating system. */
#ifndef __error_t_defined
+# define __error_t_defined 1
typedef int error_t;
-# define __error_t_defined
-#endif
-
-#ifdef __cplusplus
-extern "C" {
#endif
/* A description of a particular option. A pointer to an array of
@@ -547,7 +511,7 @@ extern void *__argp_input (const struct argp *__restrict __argp,
#ifdef __USE_EXTERN_INLINES
-# if !_LIBC
+# if !(defined _LIBC && _LIBC)
# define __argp_usage argp_usage
# define __argp_state_help argp_state_help
# define __option_is_short _option_is_short
@@ -582,7 +546,7 @@ __NTH (__option_is_end (const struct argp_option *__opt))
return !__opt->key && !__opt->name && !__opt->doc && !__opt->group;
}
-# if !_LIBC
+# if !(defined _LIBC && _LIBC)
# undef __argp_usage
# undef __argp_state_help
# undef __option_is_short
@@ -590,8 +554,6 @@ __NTH (__option_is_end (const struct argp_option *__opt))
# endif
#endif /* Use extern inlines. */
-#ifdef __cplusplus
-}
-#endif
+__END_DECLS
#endif /* argp.h */
diff --git a/argp/tst-argp1.c b/argp/tst-argp1.c
index 69c3c09564..259c440a52 100644
--- a/argp/tst-argp1.c
+++ b/argp/tst-argp1.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
diff --git a/argp/tst-argp2.c b/argp/tst-argp2.c
index cb7d03cb26..9f9d36eb8b 100644
--- a/argp/tst-argp2.c
+++ b/argp/tst-argp2.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2007-2018 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2007.