SonarCloud: fix some #undef codesmells

pull/590/head
Brad House 1 year ago
parent 2b090820bc
commit 9b1be957eb
  1. 33
      src/lib/ares_setup.h
  2. 20
      src/tools/ares_getopt.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)

@ -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

Loading…
Cancel
Save