summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-06-18 12:36:10 +0000
committerYang Tse <yangsita@gmail.com>2009-06-18 12:36:10 +0000
commit0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17 (patch)
tree97823cc0ac502e1d3d95648f24b252ac1a759d72 /m4
parentd96073913339cb935c5e2f767188b6747ce4387b (diff)
downloadc-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.tar.gz
c-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.tar.bz2
c-ares-0757cbf7f4ddeca979a0232dcd4fb0ed44c68d17.zip
add CloseSocket camel case function check
Diffstat (limited to 'm4')
-rw-r--r--m4/cares-functions.m492
1 files changed, 91 insertions, 1 deletions
diff --git a/m4/cares-functions.m4 b/m4/cares-functions.m4
index 40545d9..1da3f5a 100644
--- a/m4/cares-functions.m4
+++ b/m4/cares-functions.m4
@@ -16,7 +16,7 @@
#***************************************************************************
# File version for 'aclocal' use. Keep it a single number.
-# serial 30
+# serial 31
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 -------------------------------------------------
dnl Verify if fcntl is available, prototyped, and