aboutsummaryrefslogtreecommitdiff
path: root/src/missing/m4/type_socklen_t.m4
diff options
context:
space:
mode:
Diffstat (limited to 'src/missing/m4/type_socklen_t.m4')
-rw-r--r--src/missing/m4/type_socklen_t.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/src/missing/m4/type_socklen_t.m4 b/src/missing/m4/type_socklen_t.m4
new file mode 100644
index 0000000..349aad8
--- /dev/null
+++ b/src/missing/m4/type_socklen_t.m4
@@ -0,0 +1,25 @@
+dnl @synopsis TYPE_SOCKLEN_T
+dnl
+dnl Check whether sys/socket.h defines type socklen_t. Please note that
+dnl some systems require sys/types.h to be included before sys/socket.h
+dnl can be compiled.
+dnl
+dnl @category Misc
+dnl @author Lars Brinkhoff <lars@nocrew.org>
+dnl @version 2005-01-11
+dnl @license GPLWithACException
+
+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
+])