diff options
author | Jim Meyering <jim@meyering.net> | 2004-03-23 17:33:25 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-03-23 17:33:25 +0000 |
commit | 42401183af3f2d950ef528754106c973ceb8dffd (patch) | |
tree | bc35d04dd6a31d72d64bc00851e24254d2f13fec /lib/getopt.h | |
parent | 546413e85adb50c850fcb63bd98d30d7c420e540 (diff) | |
download | coreutils-42401183af3f2d950ef528754106c973ceb8dffd.tar.xz |
Sync from gnulib.
Diffstat (limited to 'lib/getopt.h')
-rw-r--r-- | lib/getopt.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/lib/getopt.h b/lib/getopt.h index 5e15191e6..c61768c69 100644 --- a/lib/getopt.h +++ b/lib/getopt.h @@ -1,8 +1,6 @@ /* Declarations for getopt. - - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, - 1999, 2001, 2003 Free Software Foundation, Inc. - + Copyright (C) 1989-1994,1996-1999,2001,2003,2004 + 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 @@ -36,6 +34,17 @@ # include <ctype.h> #endif +#ifndef __THROW +# ifndef __GNUC_PREREQ +# define __GNUC_PREREQ(maj, min) (0) +# endif +# if defined __cplusplus && __GNUC_PREREQ (2,8) +# define __THROW throw () +# else +# define __THROW +# endif +#endif + #ifdef __cplusplus extern "C" { #endif @@ -80,7 +89,7 @@ extern int optopt; The field `has_arg' is: no_argument (or 0) if the option does not take an argument, required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. + optional_argument (or 2) if the option takes an optional argument. If the field `flag' is not NULL, it points to a variable that is set to the value given in the field `val' when the option is found, but @@ -139,7 +148,8 @@ struct option /* Many other libraries have conflicting prototypes for getopt, with differences in the consts, in stdlib.h. To avoid compilation errors, only prototype getopt for the GNU C library. */ -extern int getopt (int ___argc, char *const *___argv, const char *__shortopts); +extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) + __THROW; #else /* not __GNU_LIBRARY__ */ extern int getopt (); #endif /* __GNU_LIBRARY__ */ @@ -147,16 +157,13 @@ extern int getopt (); #ifndef __need_getopt extern int getopt_long (int ___argc, char *const *___argv, const char *__shortopts, - const struct option *__longopts, int *__longind); + const struct option *__longopts, int *__longind) + __THROW; extern int getopt_long_only (int ___argc, char *const *___argv, const char *__shortopts, - const struct option *__longopts, int *__longind); + const struct option *__longopts, int *__longind) + __THROW; -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int ___argc, char *const *___argv, - const char *__shortopts, - const struct option *__longopts, int *__longind, - int __long_only); #endif #ifdef __cplusplus |