fix build warnings

pull/797/head
Brad House 5 months ago
parent 44d030e40f
commit 7efb5019a2
  1. 3
      CMakeLists.txt
  2. 3
      configure.ac
  3. 6
      include/ares_build.h.cmake
  4. 64
      include/ares_build.h.dist
  5. 6
      include/ares_build.h.in
  6. 4
      src/lib/ares_sysconfig_mac.c

@ -663,6 +663,9 @@ ENDIF ()
IF (HAVE_SYS_SOCKET_H)
SET (CARES_HAVE_SYS_SOCKET_H 1)
ENDIF()
IF (HAVE_SYS_SELECT_H)
SET (CARES_HAVE_SYS_SELECT_H 1)
ENDIF()
IF (HAVE_WS2TCPIP_H)
SET (CARES_HAVE_WS2TCPIP_H 1)
ENDIF()

@ -732,6 +732,9 @@ fi
if test "x$ac_cv_header_sys_socket_h" = "xyes" ; then
CARES_DEFINE_UNQUOTED([CARES_HAVE_SYS_SOCKET_H],[1])
fi
if test "x$ac_cv_header_sys_select_h" = "xyes" ; then
CARES_DEFINE_UNQUOTED([CARES_HAVE_SYS_SELECT_H],[1])
fi
if test "x$ac_cv_header_ws2tcpip_h" = "xyes" ; then
CARES_DEFINE_UNQUOTED([CARES_HAVE_WS2TCPIP_H],[1])
fi

@ -13,10 +13,10 @@
* for C-Ares */
#cmakedefine CARES_HAVE_SYS_TYPES_H
#cmakedefine CARES_HAVE_SYS_SOCKET_H
#cmakedefine CARES_HAVE_SYS_SELECT_H
#cmakedefine CARES_HAVE_WINDOWS_H
#cmakedefine CARES_HAVE_WS2TCPIP_H
#cmakedefine CARES_HAVE_WINSOCK2_H
#cmakedefine CARES_HAVE_WINDOWS_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_H
#cmakedefine CARES_HAVE_ARPA_NAMESER_COMPAT_H
@ -28,6 +28,10 @@
# include <sys/socket.h>
#endif
#ifdef CARES_HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#ifdef CARES_HAVE_WINSOCK2_H
# include <winsock2.h>
#endif

@ -143,60 +143,78 @@
#elif defined(__OS400__)
# if defined(__ILEC400__)
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
# define CARES_PULL_SYS_TYPES_H 1
# define CARES_PULL_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_TYPES_H 1
# define CARES_HAVE_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_SELECT_H 1
# endif
#elif defined(__MVS__)
# if defined(__IBMC__) || defined(__IBMCPP__)
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
# define CARES_PULL_SYS_TYPES_H 1
# define CARES_PULL_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_TYPES_H 1
# define CARES_HAVE_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_SELECT_H 1
# endif
#elif defined(__370__)
# if defined(__IBMC__) || defined(__IBMCPP__)
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
# define CARES_PULL_SYS_TYPES_H 1
# define CARES_PULL_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_TYPES_H 1
# define CARES_HAVE_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_SELECT_H 1
# endif
#elif defined(TPF)
# define CARES_TYPEOF_ARES_SOCKLEN_T int
/* ===================================== */
/* KEEP MSVC THE PENULTIMATE ENTRY */
/* ===================================== */
#elif defined(_MSC_VER)
#elif defined(_WIN32)
# define CARES_TYPEOF_ARES_SOCKLEN_T int
/* ===================================== */
/* KEEP GENERIC GCC THE LAST ENTRY */
/* ===================================== */
# define CARES_HAVE_WINDOWS_H 1
# define CARES_HAVE_SYS_TYPES_H 1
# if defined(USE_WINSOCK)
# define CARES_HAVE_WS2TCPIP_H 1
# define CARES_HAVE_WINSOCK2_H 1
# elif defined(WATT32)
# define CARES_HAVE_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_SELECT_H 1
# endif
#elif defined(__GNUC__)
# define CARES_TYPEOF_ARES_SOCKLEN_T socklen_t
# define CARES_PULL_SYS_TYPES_H 1
# define CARES_PULL_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_TYPES_H 1
# define CARES_HAVE_SYS_SOCKET_H 1
# define CARES_HAVE_SYS_SELECT_H 1
#else
# error "Unknown non-configure build target!"
Error Compilation_aborted_Unknown_non_configure_build_target
#endif
/* CARES_PULL_SYS_TYPES_H is defined above when inclusion of header file */
/* sys/types.h is required here to properly make type definitions below. */
#ifdef CARES_PULL_SYS_TYPES_H
#ifdef CARES_HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
/* CARES_PULL_SYS_SOCKET_H is defined above when inclusion of header file */
/* sys/socket.h is required here to properly make type definitions below. */
#ifdef CARES_PULL_SYS_SOCKET_H
#ifdef CARES_HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
#ifdef CARES_HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#ifdef CARES_HAVE_WINSOCK2_H
# include <winsock2.h>
#endif
#ifdef CARES_HAVE_WS2TCPIP_H
# include <ws2tcpip.h>
#endif
#ifdef CARES_HAVE_WINDOWS_H
# include <windows.h>
#endif
/* Data type definition of ares_socklen_t. */
#ifdef CARES_TYPEOF_ARES_SOCKLEN_T

@ -13,10 +13,10 @@
* for C-Ares */
#undef CARES_HAVE_SYS_TYPES_H
#undef CARES_HAVE_SYS_SOCKET_H
#undef CARES_HAVE_SYS_SELECT_H
#undef CARES_HAVE_WINDOWS_H
#undef CARES_HAVE_WS2TCPIP_H
#undef CARES_HAVE_WINSOCK2_H
#undef CARES_HAVE_WINDOWS_H
#undef CARES_HAVE_ARPA_NAMESER_H
#undef CARES_HAVE_ARPA_NAMESER_COMPAT_H
@ -28,6 +28,10 @@
# include <sys/socket.h>
#endif
#ifdef CARES_HAVE_SYS_SELECT_H
# include <sys/select.h>
#endif
#ifdef CARES_HAVE_WINSOCK2_H
# include <winsock2.h>
#endif

@ -374,7 +374,7 @@ done:
#else
/* Prevent compiler warnings due to empty unit */
static int ares_sysconfig_mac = 0;
/* Prevent compiler warnings due to empty translation unit */
typedef int make_iso_compilers_happy;
#endif

Loading…
Cancel
Save