PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/config/ac_socklen_t.m4

https://code.google.com/
m4 | 36 lines | 16 code | 3 blank | 17 comment | 0 complexity | 3e2f238cff33891d336491b1e991cbdc MD5 | raw file
 1##*****************************************************************************
 2## $Id$
 3##*****************************************************************************
 4#  AUTHOR:
 5#    Lars Brinkhoff <lars@nocrew.org>
 6#
 7#  SYNOPSIS:
 8#    TYPE_SOCKLEN_T
 9#
10#  DESCRIPTION:
11#    Check whether sys/socket.h defines type socklen_t. 
12#    Please note that some systems require sys/types.h to be included 
13#    before sys/socket.h can be compiled.
14##*****************************************************************************
15
16AC_DEFUN([TYPE_SOCKLEN_T],
17[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
18[
19  AC_TRY_COMPILE(
20  [#include <sys/types.h>
21   #include <sys/socket.h>],
22  [socklen_t len = 42; return 0;],
23  ac_cv_type_socklen_t=yes,
24  ac_cv_type_socklen_t=no)
25])
26
27if test "$ac_cv_type_socklen_t" = "yes"; then
28  AC_DEFINE([HAVE_SOCKLEN_T], [1], [Define if you have the socklen_t type.])
29fi
30
31AH_VERBATIM([HAVE_SOCKLEN_T_], 
32[#ifndef HAVE_SOCKLEN_T
33#  define HAVE_SOCKLEN_T
34   typedef int socklen_t;
35#endif])
36])