diff options
author | Yang Tse <yangsita@gmail.com> | 2007-04-16 15:35:34 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2007-04-16 15:35:34 +0000 |
commit | 827228bd69f8dd17824ae878d6211809b193eaff (patch) | |
tree | 6dfdd8d62c95c7c82dfaa9d39f5a508d8f2498c4 /ares | |
parent | 69c5506b691afc9d0f25480563f871a6260e17d8 (diff) |
move linkage var declarations to ares_getopt.h
Diffstat (limited to 'ares')
-rw-r--r-- | ares/adig.c | 5 | ||||
-rw-r--r-- | ares/ahost.c | 5 | ||||
-rw-r--r-- | ares/ares_getopt.c | 5 | ||||
-rw-r--r-- | ares/ares_getopt.h | 4 |
4 files changed, 4 insertions, 15 deletions
diff --git a/ares/adig.c b/ares/adig.c index 3a5c63efd..1eea3df69 100644 --- a/ares/adig.c +++ b/ares/adig.c @@ -53,11 +53,6 @@ #define T_SRV 33 /* server selection */ #endif -#ifndef optind -extern int optind; -extern char *optarg; -#endif - struct nv { const char *name; int value; diff --git a/ares/ahost.c b/ares/ahost.c index dfb51a931..e381c1932 100644 --- a/ares/ahost.c +++ b/ares/ahost.c @@ -40,11 +40,6 @@ #include "inet_net_pton.h" #include "ares_getopt.h" -#ifndef optind -extern int optind; -extern char *optarg; -#endif - #ifndef HAVE_STRUCT_IN6_ADDR struct in6_addr { diff --git a/ares/ares_getopt.c b/ares/ares_getopt.c index c3e81fc40..3b565a49a 100644 --- a/ares/ares_getopt.c +++ b/ares/ares_getopt.c @@ -49,11 +49,6 @@ #include <string.h> #include "ares_getopt.h" -/* declarations to provide consistent linkage */ -extern char *optarg; -extern int optind; -extern int opterr; - int opterr = 1, /* if error message should be printed */ optind = 1, /* index into parent argv vector */ optopt, /* character checked for validity */ diff --git a/ares/ares_getopt.h b/ares/ares_getopt.h index e15dc6bfc..3dafaf38f 100644 --- a/ares/ares_getopt.h +++ b/ares/ares_getopt.h @@ -33,5 +33,9 @@ int ares_getopt(int nargc, char * const nargv[], const char *ostr); +extern char *optarg; +extern int optind; +extern int opterr; + #endif /* ARES_GETOPT_H */ |