2005-09-08 Simon Josefsson <jas@extundo.com>
[gnulib.git] / m4 / socklen.m4
1 # socklen.m4 serial 1
2 dnl Copyright (C) 2005 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
6
7 dnl From Simon Josefsson.
8
9 AC_DEFUN([gl_SOCKLEN_T],
10 [
11   AC_CHECK_HEADERS_ONCE(sys/types.h sys/socket.h)
12   AC_CHECK_TYPE([socklen_t],, [AC_DEFINE([socklen_t], [int],
13                 [Map `socklen_t' to `int' if it is missing.])], [
14 #ifdef HAVE_SYS_TYPES_H
15 # include <sys/types.h>
16 #endif
17 #ifdef HAVE_SYS_SOCKET_H
18 # include <sys/socket.h>
19 #endif)
20 ])