socklen-t-check-20090316
[openafs.git] / src / cf / socklen.m4
1 AC_DEFUN([AC_TYPE_SOCKLEN_T],
2 [
3 AC_CACHE_CHECK([for socklen_t], 
4 ac_cv_type_socklen_t, [
5         AC_TRY_COMPILE([
6                       #include <sys/types.h>
7                       #include <sys/socket.h>
8               ],
9               [
10                       socklen_t len = 42; return 0;
11               ],
12               ac_cv_type_socklen_t="yes", ac_cv_type_socklen_t="no")
13         ])
14
15         if test "x$ac_cv_type_socklen_t" = "xno"; then
16               AC_DEFINE(socklen_t, int, [the type of the last argument to getsockopt etc])
17         fi
18 ])