From e6d3eaa69871d800eb078580b64f2bc5806a0fcc Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 23 Mar 2017 08:51:44 -0700 Subject: Merge from gnulib This incorporates: 2017-03-22 getopt: merge from glibc * build-aux/config.sub, lib/getopt.c, lib/getopt.in.h: * lib/getopt1.c, lib/getopt_int.h: Copy from gnulib. * lib/gnulib.mk.in: Regenerate. --- lib/getopt.in.h | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) (limited to 'lib/getopt.in.h') diff --git a/lib/getopt.in.h b/lib/getopt.in.h index 6cbad8e0339..3f57c68a25e 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -1,20 +1,20 @@ /* Declarations for getopt. - Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2017 Free Software - Foundation, Inc. + Copyright (C) 1989-2017 Free Software Foundation, Inc. This file is part of the GNU C Library. - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 3 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program. If not, see . */ + You should have received a copy of the GNU General Public + License along with the GNU C Library; if not, see + . */ #ifndef _@GUARD_PREFIX@_GETOPT_H @@ -238,6 +238,25 @@ struct option extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) __THROW _GL_ARG_NONNULL ((2, 3)); +#ifndef __GETOPT_PREFIX +# if defined __need_getopt && defined __USE_POSIX2 \ + && !defined __USE_POSIX_IMPLICITLY && !defined __USE_GNU +/* The GNU getopt has more functionality than the standard version. The + additional functionality can be disable at runtime. This redirection + helps to also do this at runtime. */ +# ifdef __REDIRECT + extern int __REDIRECT_NTH (getopt, (int ___argc, char *const *___argv, + const char *__shortopts), + __posix_getopt); +# else +extern int __posix_getopt (int ___argc, char *const *___argv, + const char *__shortopts) + __THROW _GL_ARG_NONNULL ((2, 3)); +# define getopt __posix_getopt +# endif +# endif +#endif + #ifndef __need_getopt extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv, const char *__shortopts, -- cgit v1.2.3