1601
dnl CURL_CHECK_FUNC_RECVFROM
1602
dnl -------------------------------------------------
1603
dnl Test if the socket recvfrom() function is available,
1604
dnl and check its return type and the types of its
1605
dnl arguments. If the function succeeds HAVE_RECVFROM
1606
dnl will be defined, defining the types of the arguments
1607
dnl in RECVFROM_TYPE_ARG1, RECVFROM_TYPE_ARG2, and so on
1608
dnl to RECVFROM_TYPE_ARG6, defining also the type of the
1609
dnl function return value in RECVFROM_TYPE_RETV.
1610
dnl Notice that the types returned for pointer arguments
1611
dnl will actually be the type pointed by the pointer.
1613
AC_DEFUN([CURL_CHECK_FUNC_RECVFROM], [
1614
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK])dnl
1615
AC_REQUIRE([CURL_CHECK_HEADER_WINSOCK2])dnl
1616
AC_CHECK_HEADERS(sys/types.h sys/socket.h)
1618
AC_MSG_CHECKING([for recvfrom])
1622
#ifdef HAVE_WINDOWS_H
1623
#ifndef WIN32_LEAN_AND_MEAN
1624
#define WIN32_LEAN_AND_MEAN
1626
#include <windows.h>
1627
#ifdef HAVE_WINSOCK2_H
1628
#include <winsock2.h>
1630
#ifdef HAVE_WINSOCK_H
1631
#include <winsock.h>
1635
#ifdef HAVE_SYS_TYPES_H
1636
#include <sys/types.h>
1638
#ifdef HAVE_SYS_SOCKET_H
1639
#include <sys/socket.h>
1643
recvfrom(0, 0, 0, 0, 0, 0);
1646
AC_MSG_RESULT([yes])
1647
curl_cv_recvfrom="yes"
1650
curl_cv_recvfrom="no"
1653
if test "$curl_cv_recvfrom" = "yes"; then
1654
AC_CACHE_CHECK([types of args and return type for recvfrom],
1655
[curl_cv_func_recvfrom_args], [
1656
curl_cv_func_recvfrom_args="unknown"
1657
for recvfrom_retv in 'int' 'ssize_t'; do
1658
for recvfrom_arg1 in 'int' 'ssize_t' 'SOCKET'; do
1659
for recvfrom_arg2 in 'char *' 'void *'; do
1660
for recvfrom_arg3 in 'size_t' 'int' 'socklen_t' 'unsigned int'; do
1661
for recvfrom_arg4 in 'int' 'unsigned int'; do
1662
for recvfrom_arg5 in 'struct sockaddr *' 'void *' 'const struct sockaddr *'; do
1663
for recvfrom_arg6 in 'socklen_t *' 'int *' 'unsigned int *' 'size_t *' 'void *'; do
1664
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1668
#ifdef HAVE_WINDOWS_H
1669
#ifndef WIN32_LEAN_AND_MEAN
1670
#define WIN32_LEAN_AND_MEAN
1672
#include <windows.h>
1673
#ifdef HAVE_WINSOCK2_H
1674
#include <winsock2.h>
1676
#ifdef HAVE_WINSOCK_H
1677
#include <winsock.h>
1680
#define RECVFROMCALLCONV PASCAL
1682
#ifdef HAVE_SYS_TYPES_H
1683
#include <sys/types.h>
1685
#ifdef HAVE_SYS_SOCKET_H
1686
#include <sys/socket.h>
1688
#define RECVFROMCALLCONV
1690
extern $recvfrom_retv RECVFROMCALLCONV
1691
recvfrom($recvfrom_arg1, $recvfrom_arg2,
1692
$recvfrom_arg3, $recvfrom_arg4,
1693
$recvfrom_arg5, $recvfrom_arg6);
1696
$recvfrom_arg2 buf=0;
1697
$recvfrom_arg3 len=0;
1698
$recvfrom_arg4 flags=0;
1699
$recvfrom_arg5 addr=0;
1700
$recvfrom_arg6 addrlen=0;
1701
$recvfrom_retv res=0;
1702
res = recvfrom(s, buf, len, flags, addr, addrlen);
1705
curl_cv_func_recvfrom_args="$recvfrom_arg1,$recvfrom_arg2,$recvfrom_arg3,$recvfrom_arg4,$recvfrom_arg5,$recvfrom_arg6,$recvfrom_retv"
1716
# Nearly last minute change for this release starts here
1717
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1718
[Define to 1 if you have the recvfrom function.])
1719
ac_cv_func_recvfrom="yes"
1720
# Nearly last minute change for this release ends here
1721
if test "$curl_cv_func_recvfrom_args" = "unknown"; then
1722
AC_MSG_WARN([Cannot find proper types to use for recvfrom args])
1724
recvfrom_prev_IFS=$IFS; IFS=','
1725
set dummy `echo "$curl_cv_func_recvfrom_args" | sed 's/\*/\*/g'`
1726
IFS=$recvfrom_prev_IFS
1729
recvfrom_ptrt_arg2=$[2]
1730
recvfrom_qual_ptrt_arg5=$[5]
1731
recvfrom_ptrt_arg6=$[6]
1733
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG1, $[1],
1734
[Define to the type of arg 1 for recvfrom.])
1735
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG3, $[3],
1736
[Define to the type of arg 3 for recvfrom.])
1737
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG4, $[4],
1738
[Define to the type of arg 4 for recvfrom.])
1739
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_RETV, $[7],
1740
[Define to the function return type for recvfrom.])
1744
case $prev_sh_opts in
1752
case "$recvfrom_qual_ptrt_arg5" in
1754
recvfrom_qual_arg5=const
1755
recvfrom_ptrt_arg5=`echo $recvfrom_qual_ptrt_arg5 | sed 's/^const //'`
1759
recvfrom_ptrt_arg5=$recvfrom_qual_ptrt_arg5
1763
recvfrom_type_arg2=`echo $recvfrom_ptrt_arg2 | sed 's/ \*//'`
1764
recvfrom_type_arg5=`echo $recvfrom_ptrt_arg5 | sed 's/ \*//'`
1765
recvfrom_type_arg6=`echo $recvfrom_ptrt_arg6 | sed 's/ \*//'`
1767
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2, $recvfrom_type_arg2,
1768
[Define to the type pointed by arg 2 for recvfrom.])
1769
AC_DEFINE_UNQUOTED(RECVFROM_QUAL_ARG5, $recvfrom_qual_arg5,
1770
[Define to the type qualifier pointed by arg 5 for recvfrom.])
1771
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5, $recvfrom_type_arg5,
1772
[Define to the type pointed by arg 5 for recvfrom.])
1773
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6, $recvfrom_type_arg6,
1774
[Define to the type pointed by arg 6 for recvfrom.])
1776
if test "$recvfrom_type_arg2" = "void"; then
1777
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG2_IS_VOID, 1,
1778
[Define to 1 if the type pointed by arg 2 for recvfrom is void.])
1780
if test "$recvfrom_type_arg5" = "void"; then
1781
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG5_IS_VOID, 1,
1782
[Define to 1 if the type pointed by arg 5 for recvfrom is void.])
1784
if test "$recvfrom_type_arg6" = "void"; then
1785
AC_DEFINE_UNQUOTED(RECVFROM_TYPE_ARG6_IS_VOID, 1,
1786
[Define to 1 if the type pointed by arg 6 for recvfrom is void.])
1789
case $prev_sh_opts in
1797
AC_DEFINE_UNQUOTED(HAVE_RECVFROM, 1,
1798
[Define to 1 if you have the recvfrom function.])
1799
ac_cv_func_recvfrom="yes"
1802
AC_MSG_WARN([Unable to link function recvfrom])
1807
1600
dnl CURL_CHECK_MSG_NOSIGNAL
1808
1601
dnl -------------------------------------------------
1809
1602
dnl Check for MSG_NOSIGNAL