From 1195efd83bf821e8852c03a62860c350f696139b Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Mon, 16 Mar 2009 16:14:21 +0000 Subject: [PATCH] DEVEL15-socklen-t-check-20090316 LICENSE IPL10 verify we have socklen_t and if not, get it (cherry picked from commit 2d683a880bf5f30db22862f0f6add14142dbcf9a) --- acinclude.m4 | 1 + src/cf/socklen.m4 | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/cf/socklen.m4 diff --git a/acinclude.m4 b/acinclude.m4 index 395e7fbfc4..7577beac03 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -323,6 +323,7 @@ dnl Various compiler setup. AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SIGNAL +AC_TYPE_SOCKLEN_T AC_CHECK_TYPES(sig_t, , , [#include #include ]) diff --git a/src/cf/socklen.m4 b/src/cf/socklen.m4 new file mode 100644 index 0000000000..50ee10f1df --- /dev/null +++ b/src/cf/socklen.m4 @@ -0,0 +1,18 @@ +AC_DEFUN([AC_TYPE_SOCKLEN_T], +[ +AC_CACHE_CHECK([for socklen_t], +ac_cv_type_socklen_t, [ + AC_TRY_COMPILE([ + #include + #include + ], + [ + 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 +])