X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=getopt%2Fgetopt.h;h=da0a54adc618e07f2abc19d0b7c79615e527c48e;hb=82a12d49ecd2c09c301e6513b549c358f715e764;hp=95ba4e184455665a6aaa6dc6543dc45d9df4bf28;hpb=43259365c0fa2788f15e1100491271dd910f5a6f;p=ctsim.git diff --git a/getopt/getopt.h b/getopt/getopt.h index 95ba4e1..da0a54a 100644 --- a/getopt/getopt.h +++ b/getopt/getopt.h @@ -19,6 +19,10 @@ #ifndef _GETOPT_H +#ifdef HAVE_CONFIG_H +#include "../config.h" +#endif + #ifndef __need_getopt # define _GETOPT_H 1 #endif @@ -82,7 +86,7 @@ extern int optopt; struct option { -# if defined __STDC__ && __STDC__ +# if defined __STDC__ const char *name; # else char *name; @@ -126,14 +130,14 @@ struct option arguments to the option '\0'. This behavior is specific to the GNU `getopt'. */ -#if defined __STDC__ && __STDC__ +#if defined __STDC__ # ifdef __GNU_LIBRARY__ /* 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); # else /* not __GNU_LIBRARY__ */ -extern int getopt (); + /* extern int getopt (); */ # endif /* __GNU_LIBRARY__ */ # ifndef __need_getopt @@ -152,10 +156,15 @@ extern int _getopt_internal (int __argc, char *const *__argv, #else /* not __STDC__ */ extern int getopt (); # ifndef __need_getopt -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind); +extern int _getopt_internal (int __argc, char *const *__argv, + const char *__shortopts, + const struct option *__longopts, int *__longind, + int __long_only); # endif #endif /* __STDC__ */