Hello, * Mats E Andersson wrote on Sat, Apr 09, 2011 at 02:23:27PM CEST: > the m4 helper in `m4/getaddrinfo.m4` is incorrectly implementing > a test whether `struct sockaddr` contains a member `sa_len`. > > Any BSD system must include `<sys/types.h>` in order for the test > code to deliver a trustworthy answer. As always this header must > precede `<sys/socket.h>` on any BSD system.
The test should be using AC_INCLUDES_DEFAULT, no? That takes care of sys/types.h: AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [AC_INCLUDES_DEFAULT [#include <sys/socket.h> ]]) Thanks, Ralf > --- a/m4/getaddrinfo.m4 > +++ b/m4/getaddrinfo.m4 > @@ -105,7 +105,9 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ > > dnl Including sys/socket.h is wrong for Windows, but Windows does not > dnl have sa_len so the result is correct anyway. > - AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include <sys/socket.h>]) > + AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [ > +#include <sys/types.h> > +#include <sys/socket.h>]) > > AC_CHECK_HEADERS_ONCE([netinet/in.h])