diff options
author | John Gilmore <gnu@cygnus> | 1992-10-16 10:20:52 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-10-16 10:20:52 +0000 |
commit | 0a9266896a8b50d88a009d0efee3dca42d4b21fa (patch) | |
tree | f9145f1ac20d136d37199c732683760c39aa30ac /include | |
parent | 5a56198d68b7f6d75934a5167a1e0bb246bd1c44 (diff) | |
download | gdb-0a9266896a8b50d88a009d0efee3dca42d4b21fa.zip gdb-0a9266896a8b50d88a009d0efee3dca42d4b21fa.tar.gz gdb-0a9266896a8b50d88a009d0efee3dca42d4b21fa.tar.bz2 |
* getopt.h (struct option): RMS decided we should do it the other way.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/getopt.h | 26 |
2 files changed, 21 insertions, 10 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 2f038ae..08bd911 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +Fri Oct 16 03:17:08 1992 John Gilmore (gnu@cygnus.com) + + * getopt.h (struct option): RMS decided we should do it the + other way. + Thu Oct 15 21:43:22 1992 K. Richard Pixley (rich@sendai.cygnus.com) * getopt.h (struct option): use the provided enum for has_arg. diff --git a/include/getopt.h b/include/getopt.h index 6f42f80..7dfb6e6 100644 --- a/include/getopt.h +++ b/include/getopt.h @@ -70,15 +70,6 @@ extern int opterr; one). For long options that have a zero `flag' field, `getopt' returns the contents of the `val' field. */ -/* Names for the values of the `has_arg' field of `struct option'. */ - -enum _argtype -{ - no_argument, - required_argument, - optional_argument -}; - struct option { #if __STDC__ @@ -88,11 +79,26 @@ struct option #endif /* has_arg can't be an enum because some compilers complain about type mismatches in all the code that assumes it is an int. */ - enum _argtype has_arg; + int has_arg; int *flag; int val; }; +/* Names for the values of the `has_arg' field of `struct option'. + We wouldn't mind doing this: + enum _argtype + { + no_argument, + required_argument, + optional_argument + }; + ...if we could also change the "int has_arg" above. For now, use + defines. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + #if __STDC__ extern int getopt (int argc, char *const *argv, const char *shortopts); extern int getopt_long (int argc, char *const *argv, const char *shortopts, |