add CloseSocket camel case function check

This commit is contained in:
Yang Tse
2009-06-18 12:36:10 +00:00
parent d960739133
commit 0757cbf7f4
2 changed files with 92 additions and 1 deletions
+1
View File
@@ -536,6 +536,7 @@ CURL_CHECK_FUNC_SEND
CURL_CHECK_MSG_NOSIGNAL CURL_CHECK_MSG_NOSIGNAL
CARES_CHECK_FUNC_CLOSESOCKET CARES_CHECK_FUNC_CLOSESOCKET
CARES_CHECK_FUNC_CLOSESOCKET_CAMEL
CARES_CHECK_FUNC_FCNTL CARES_CHECK_FUNC_FCNTL
CARES_CHECK_FUNC_FREEADDRINFO CARES_CHECK_FUNC_FREEADDRINFO
CARES_CHECK_FUNC_GETADDRINFO CARES_CHECK_FUNC_GETADDRINFO
+91 -1
View File
@@ -16,7 +16,7 @@
#*************************************************************************** #***************************************************************************
# File version for 'aclocal' use. Keep it a single number. # File version for 'aclocal' use. Keep it a single number.
# serial 30 # serial 31
dnl CARES_INCLUDES_ARPA_INET dnl CARES_INCLUDES_ARPA_INET
@@ -434,6 +434,96 @@ AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET], [
]) ])
dnl CARES_CHECK_FUNC_CLOSESOCKET_CAMEL
dnl -------------------------------------------------
dnl Verify if CloseSocket is available, prototyped, and
dnl can be compiled. If all of these are true, and
dnl usage has not been previously disallowed with
dnl shell variable cares_disallow_closesocket_camel,
dnl then HAVE_CLOSESOCKET_CAMEL will be defined.
AC_DEFUN([CARES_CHECK_FUNC_CLOSESOCKET_CAMEL], [
AC_REQUIRE([CARES_INCLUDES_SYS_SOCKET])dnl
#
tst_links_closesocket_camel="unknown"
tst_proto_closesocket_camel="unknown"
tst_compi_closesocket_camel="unknown"
tst_allow_closesocket_camel="unknown"
#
AC_MSG_CHECKING([if CloseSocket can be linked])
AC_LINK_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_sys_socket
]],[[
if(0 != CloseSocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_links_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_links_closesocket_camel="no"
])
#
if test "$tst_links_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket is prototyped])
AC_EGREP_CPP([CloseSocket],[
$cares_includes_sys_socket
],[
AC_MSG_RESULT([yes])
tst_proto_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_proto_closesocket_camel="no"
])
fi
#
if test "$tst_proto_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket is compilable])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[
$cares_includes_sys_socket
]],[[
if(0 != CloseSocket(0))
return 1;
]])
],[
AC_MSG_RESULT([yes])
tst_compi_closesocket_camel="yes"
],[
AC_MSG_RESULT([no])
tst_compi_closesocket_camel="no"
])
fi
#
if test "$tst_compi_closesocket_camel" = "yes"; then
AC_MSG_CHECKING([if CloseSocket usage allowed])
if test "x$cares_disallow_closesocket_camel" != "xyes"; then
AC_MSG_RESULT([yes])
tst_allow_closesocket_camel="yes"
else
AC_MSG_RESULT([no])
tst_allow_closesocket_camel="no"
fi
fi
#
AC_MSG_CHECKING([if CloseSocket might be used])
if test "$tst_links_closesocket_camel" = "yes" &&
test "$tst_proto_closesocket_camel" = "yes" &&
test "$tst_compi_closesocket_camel" = "yes" &&
test "$tst_allow_closesocket_camel" = "yes"; then
AC_MSG_RESULT([yes])
AC_DEFINE_UNQUOTED(HAVE_CLOSESOCKET_CAMEL, 1,
[Define to 1 if you have the CloseSocket camel case function.])
ac_cv_func_closesocket_camel="yes"
else
AC_MSG_RESULT([no])
ac_cv_func_closesocket_camel="no"
fi
])
dnl CARES_CHECK_FUNC_FCNTL dnl CARES_CHECK_FUNC_FCNTL
dnl ------------------------------------------------- dnl -------------------------------------------------
dnl Verify if fcntl is available, prototyped, and dnl Verify if fcntl is available, prototyped, and