Commit 77b3bc23 authored by Yang Tse's avatar Yang Tse
Browse files

First step trying to avoid the multiple header inclusion and recursion nightmare.

Reintroduce checking for HAVE_MSG_NOSIGNAL in configure script, so that we don't depend on header inclusion order for a valid check.
parent c10d15aa
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -926,6 +926,39 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
]) # AC_DEFUN


dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL

AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
  AC_CHECK_HEADERS(sys/types.h sys/socket.h)
  AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
    AC_COMPILE_IFELSE([
      AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
      ],[
        int flag=MSG_NOSIGNAL;
      ])
    ],[
      ac_cv_msg_nosignal="yes"
    ],[
      ac_cv_msg_nosignal="no"
    ])
  ])
  case "$ac_cv_msg_nosignal" in
    yes)
      AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
        [Define to 1 if you have the MSG_NOSIGNAL flag.])
      ;;
  esac
]) # AC_DEFUN


dnl CURL_CHECK_NONBLOCKING_SOCKET
dnl -------------------------------------------------
dnl Check for how to set a socket to non-blocking state. There seems to exist
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ ares_expand_string.c ares_parse_ptr_reply.c ares_parse_aaaa_reply.c \
ares_getnameinfo.c inet_net_pton.c bitncmp.c inet_ntop.c

HHEADERS = ares.h ares_private.h setup.h ares_dns.h ares_version.h          \
           nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h
           nameser.h inet_net_pton.h inet_ntop.h ares_ipv6.h bitncmp.h      \
           setup_once.h 

MANPAGES= ares_destroy.3 ares_expand_name.3 ares_expand_string.3 ares_fds.3 \
 ares_free_hostent.3 ares_free_string.3 ares_gethostbyaddr.3                \
+33 −0
Original line number Diff line number Diff line
@@ -904,6 +904,39 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
]) # AC_DEFUN


dnl CURL_CHECK_MSG_NOSIGNAL
dnl -------------------------------------------------
dnl Check for MSG_NOSIGNAL

AC_DEFUN([CURL_CHECK_MSG_NOSIGNAL], [
  AC_CHECK_HEADERS(sys/types.h sys/socket.h)
  AC_CACHE_CHECK([for MSG_NOSIGNAL], [ac_cv_msg_nosignal], [
    AC_COMPILE_IFELSE([
      AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
      ],[
        int flag=MSG_NOSIGNAL;
      ])
    ],[
      ac_cv_msg_nosignal="yes"
    ],[
      ac_cv_msg_nosignal="no"
    ])
  ])
  case "$ac_cv_msg_nosignal" in
    yes)
      AC_DEFINE_UNQUOTED(HAVE_MSG_NOSIGNAL, 1,
        [Define to 1 if you have the MSG_NOSIGNAL flag.])
      ;;
  esac
]) # AC_DEFUN


dnl CURL_CHECK_NONBLOCKING_SOCKET
dnl -------------------------------------------------
dnl Check for how to set a socket to non-blocking state. There seems to exist
+2 −0
Original line number Diff line number Diff line
@@ -179,6 +179,8 @@ CURL_CHECK_FUNC_RECV

CURL_CHECK_FUNC_SEND

CURL_CHECK_MSG_NOSIGNAL

dnl check for AF_INET6
CARES_CHECK_CONSTANT(
  [
+8 −0
Original line number Diff line number Diff line
@@ -149,4 +149,12 @@ int ares_strcasecmp(const char *s1, const char *s2);
#endif
#endif

/*
 * Include macros and defines that should only be processed once.
 */

#ifndef __SETUP_ONCE_H
#include "setup_once.h"
#endif

#endif /* __ARES_SETUP_H */
Loading