move linkage var declarations to ares_getopt.h
authorYang Tse <yangsita@gmail.com>
Mon, 16 Apr 2007 15:35:34 +0000 (15:35 +0000)
committerYang Tse <yangsita@gmail.com>
Mon, 16 Apr 2007 15:35:34 +0000 (15:35 +0000)
ares/adig.c
ares/ahost.c
ares/ares_getopt.c
ares/ares_getopt.h

index 3a5c63e..1eea3df 100644 (file)
 #define T_SRV 33 /* server selection */
 #endif
 
-#ifndef optind
-extern int optind;
-extern char *optarg;
-#endif
-
 struct nv {
   const char *name;
   int value;
index dfb51a9..e381c19 100644 (file)
 #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
 {
index c3e81fc..3b565a4 100644 (file)
 #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 */
index e15dc6b..3dafaf3 100644 (file)
@@ -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 */