Back to the Main Page.

type_socklen_t

Download the M4 Source.

Synopsis

TYPE_SOCKLEN_T

Version

2005-01-11     0.5.65   :   Misc

Author

Lars Brinkhoff <lars@nocrew.org>
license: GPLWithACException

Description

Check whether sys/socket.h defines type socklen_t. Please note that some systems require sys/types.h to be included before sys/socket.h can be compiled.

M4 Source Code

AC_DEFUN([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 $ac_cv_type_socklen_t != yes; then
    AC_DEFINE(socklen_t, int, [Substitute for socklen_t])
  fi
])