summaryrefslogtreecommitdiffstats
path: root/gl/m4/socklen.m4
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-08 01:11:46 (GMT)
committerThomas Guyot-Sionnest <dermoth@aei.ca>2010-04-13 01:26:35 (GMT)
commit74da141e618ef99959d509cb2e7be35a348a39db (patch)
tree88ebc38b381a1021fc2d74864a71e230ae591c3d /gl/m4/socklen.m4
parentc63a4f726a0b6ad8cf6040f947754a81fd4683bb (diff)
downloadmonitoring-plugins-74da141e618ef99959d509cb2e7be35a348a39db.tar.gz
Sync with the latest Gnulib code (177f525)
Signed-off-by: Thomas Guyot-Sionnest <dermoth@aei.ca>
Diffstat (limited to 'gl/m4/socklen.m4')
-rw-r--r--gl/m4/socklen.m440
1 files changed, 20 insertions, 20 deletions
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
index b755757..2933d4b 100644
--- a/gl/m4/socklen.m4
+++ b/gl/m4/socklen.m4
@@ -1,5 +1,5 @@
1# socklen.m4 serial 6 1# socklen.m4 serial 7
2dnl Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. 2dnl Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 5dnl with or without modifications, as long as this notice is preserved.
@@ -20,30 +20,30 @@ AC_DEFUN([gl_TYPE_SOCKLEN_T],
20 AC_CHECK_TYPE([socklen_t], , 20 AC_CHECK_TYPE([socklen_t], ,
21 [AC_MSG_CHECKING([for socklen_t equivalent]) 21 [AC_MSG_CHECKING([for socklen_t equivalent])
22 AC_CACHE_VAL([gl_cv_socklen_t_equiv], 22 AC_CACHE_VAL([gl_cv_socklen_t_equiv],
23 [# Systems have either "struct sockaddr *" or 23 [# Systems have either "struct sockaddr *" or
24 # "void *" as the second argument to getpeername 24 # "void *" as the second argument to getpeername
25 gl_cv_socklen_t_equiv= 25 gl_cv_socklen_t_equiv=
26 for arg2 in "struct sockaddr" void; do 26 for arg2 in "struct sockaddr" void; do
27 for t in int size_t "unsigned int" "long int" "unsigned long int"; do 27 for t in int size_t "unsigned int" "long int" "unsigned long int"; do
28 AC_TRY_COMPILE( 28 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
29 [#include <sys/types.h> 29 [[#include <sys/types.h>
30 #include <sys/socket.h> 30 #include <sys/socket.h>
31 31
32 int getpeername (int, $arg2 *, $t *);], 32 int getpeername (int, $arg2 *, $t *);]],
33 [$t len; 33 [[$t len;
34 getpeername (0, 0, &len);], 34 getpeername (0, 0, &len);]])],
35 [gl_cv_socklen_t_equiv="$t"]) 35 [gl_cv_socklen_t_equiv="$t"])
36 test "$gl_cv_socklen_t_equiv" != "" && break 36 test "$gl_cv_socklen_t_equiv" != "" && break
37 done 37 done
38 test "$gl_cv_socklen_t_equiv" != "" && break 38 test "$gl_cv_socklen_t_equiv" != "" && break
39 done 39 done
40 ]) 40 ])
41 if test "$gl_cv_socklen_t_equiv" = ""; then 41 if test "$gl_cv_socklen_t_equiv" = ""; then
42 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t]) 42 AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
43 fi 43 fi
44 AC_MSG_RESULT([$gl_cv_socklen_t_equiv]) 44 AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
45 AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv], 45 AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
46 [type to use in place of socklen_t if not defined])], 46 [type to use in place of socklen_t if not defined])],
47 [#include <sys/types.h> 47 [#include <sys/types.h>
48 #if HAVE_SYS_SOCKET_H 48 #if HAVE_SYS_SOCKET_H
49 # include <sys/socket.h> 49 # include <sys/socket.h>