Use the standard AC_CHECK_TYPES mechanism to check for the existence
of socklen_t, and to typedef it as an int if it's not found, rather
than growing our own.
Change-Id: Ib5aeb600750558167f63833dd4a7480dbe312b8a
Reviewed-on: http://gerrit.openafs.org/1972
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
AC_MSG_RESULT(no)
fi
-AC_TYPE_SOCKLEN_T
AC_TYPE_SIGNAL
AC_CHECK_SIZEOF(void *)
AC_CHECK_SIZEOF(unsigned long long)
AC_CHECK_TYPES([sig_atomic_t],[],[],
[#include <sys/types.h>
#include <signal.h>])
+AC_CHECK_TYPES([socklen_t],[],[],
+[#include <sys/types.h>
+#include <sys/socket.h>])
AC_SIZEOF_TYPE(long)
AC_HEADER_PAM_CONST
+++ /dev/null
-AC_DEFUN([AC_TYPE_SOCKLEN_T],
-[
-AC_CACHE_CHECK([for socklen_t],
-ac_cv_type_socklen_t, [
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <sys/socket.h>
- ],
- [
- socklen_t len = 42; return 0;
- ],
- ac_cv_type_socklen_t="yes", ac_cv_type_socklen_t="no")
- ])
-
- if test "x$ac_cv_type_socklen_t" = "xno"; then
- AC_DEFINE(socklen_t, int, [the type of the last argument to getsockopt etc])
- fi
-])
#endif
/* Windows does not provide socklen_t prior to WDK 6.0 */
-typedef int socklen_t;
+#undef HAVE_SOCKLEN_T
typedef int sig_atomic_t;
#endif
+#ifndef HAVE_SOCKLEN_T
+typedef int socklen_t;
+#endif
+
typedef short afs_int16;
typedef unsigned short afs_uint16;
#ifdef AFS_64BIT_ENV