diff --git a/src/lib/ares_setup.h b/src/lib/ares_setup.h index e8d39548..0387f3e3 100644 --- a/src/lib/ares_setup.h +++ b/src/lib/ares_setup.h @@ -138,8 +138,9 @@ * undefine USE_WINSOCK. */ -#undef USE_WINSOCK - +#ifdef USE_WINSOCK +# undef USE_WINSOCK +#endif #ifdef HAVE_WINSOCK2_H # define USE_WINSOCK 2 #else @@ -203,13 +204,27 @@ * --enable-debug) so we undef them again here. */ -#undef PACKAGE_STRING -#undef PACKAGE_TARNAME -#undef PACKAGE_VERSION -#undef PACKAGE_BUGREPORT -#undef PACKAGE_NAME -#undef VERSION -#undef PACKAGE +#ifdef PACKAGE_STRING +# undef PACKAGE_STRING +#endif +#ifdef PACKAGE_TARNAME +# undef PACKAGE_TARNAME +#endif +#ifdef PACKAGE_VERSION +# undef PACKAGE_VERSION +#endif +#ifdef PACKAGE_BUGREPORT +# undef PACKAGE_BUGREPORT +#endif +#ifdef PACKAGE_NAME +# undef PACKAGE_NAME +#endif +#ifdef VERSION +# undef VERSION +#endif +#ifdef PACKAGE +# undef PACKAGE +#endif /* IPv6 compatibility */ #if !defined(HAVE_AF_INET6) diff --git a/src/tools/ares_getopt.h b/src/tools/ares_getopt.h index 040184e6..b80da752 100644 --- a/src/tools/ares_getopt.h +++ b/src/tools/ares_getopt.h @@ -35,11 +35,21 @@ int ares_getopt(int nargc, char * const nargv[], const char *ostr); -#undef optarg -#undef optind -#undef opterr -#undef optopt -#undef optreset +#ifdef optarg +# undef optarg +#endif +#ifdef optind +# undef optind +#endif +#ifdef opterr +# undef opterr +#endif +#ifdef optopt +# undef optopt +#endif +#ifdef optreset +# undef optreset +#endif #define optarg ares_optarg #define optind ares_optind