@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/config/ac_func_accept_argtypes.m4,v 1.2 2000/08/26 21:11:45 petere Exp $
# $Header: /cvsroot/pgsql/config/ac_func_accept_argtypes.m4,v 1.3 2000/11/09 18:18:42 petere Exp $
# This comes from the official Autoconf macro archive at
# This comes from the official Autoconf macro archive at
# <http://research.cys.de/autoconf-archive/>
# <http://research.cys.de/autoconf-archive/>
# (I removed the $ before the Id CVS keyword below.)
# (I removed the $ before the Id CVS keyword below.)
@ -32,6 +32,10 @@ dnl
#
#
# arg2 can also be `const' (e.g., RH 4.2). Change the order of tests
# arg2 can also be `const' (e.g., RH 4.2). Change the order of tests
# for arg3 so that `int' is first, in case there is no prototype at all.
# for arg3 so that `int' is first, in case there is no prototype at all.
#
# Solaris 7 and 8 have arg3 as 'void *' (disguised as 'Psocklen_t'
# which is *not* 'socklen_t *'). If we detect that, then we assume
# 'int' as the result, because that ought to work best.
AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES,
AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES,
[AC_MSG_CHECKING([types of arguments for accept()])
[AC_MSG_CHECKING([types of arguments for accept()])
@ -40,7 +44,7 @@ AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES,
[AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
[AC_CACHE_VAL(ac_cv_func_accept_arg3,dnl
[for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
[for ac_cv_func_accept_arg1 in 'int' 'unsigned int'; do
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for ac_cv_func_accept_arg2 in 'struct sockaddr *' 'const struct sockaddr *' 'void *'; do
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int'; do
for ac_cv_func_accept_arg3 in 'int' 'size_t' 'socklen_t' 'unsigned int' 'void' ; do
AC_TRY_COMPILE(
AC_TRY_COMPILE(
[#ifdef HAVE_SYS_TYPES_H
[#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#include <sys/types.h>
@ -48,7 +52,7 @@ AC_DEFUN(AC_FUNC_ACCEPT_ARGTYPES,
#ifdef HAVE_SYS_SOCKET_H
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#include <sys/socket.h>
#endif
#endif
extern accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);],
extern int accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_accept_arg3 *);],
[], [ac_not_found=no; break 3], [ac_not_found=yes])
[], [ac_not_found=no; break 3], [ac_not_found=yes])
done
done
done
done
@ -56,6 +60,9 @@ extern accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_acc
if test "$ac_not_found" = yes; then
if test "$ac_not_found" = yes; then
AC_MSG_ERROR([could not determine argument types])
AC_MSG_ERROR([could not determine argument types])
fi
fi
if test "$ac_cv_func_accept_arg3" = "void"; then
ac_cv_func_accept_arg3=int
fi
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL
])dnl AC_CACHE_VAL