[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: would like to break sys_select's dependency on sys_socket
From: |
Bruno Haible |
Subject: |
Re: would like to break sys_select's dependency on sys_socket |
Date: |
Mon, 4 Jul 2011 01:31:44 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Paul,
> Here's what I just now pushed. It works for non-Windows... but has not been
> tested
> on native Windows.
And it does not work on native Windows. Here's a build of
./gnulib-tool --create-testdir --dir=... --with-tests --single-configure
sys_select
on mingw:
make[4]: Entering directory
`/home/bruno/multibuild-1132/mingw2009/testdir1/gltests'
gcc-3 -mno-cygwin -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1
-DIN_GNULIB_TESTS=1 -I. -I. -I.. -I./.. -I../gllib -I./../gllib
-I/usr/local/mingw/include -Wall -g -O2 -MT test-sys_select.o -MD -MP -MF
.deps/test-sys_select.Tpo -c -o test-sys_select.o test-sys_select.c
In file included from test-sys_select.c:21:
../gllib/sys/select.h:85:26: sys/socket.h: No such file or directory
test-sys_select.c: In function `main':
test-sys_select.c:31: error: `fd_set' undeclared (first use in this function)
test-sys_select.c:31: error: (Each undeclared identifier is reported only once
test-sys_select.c:31: error: for each function it appears in.)
test-sys_select.c:31: error: parse error before "fds"
test-sys_select.c:32: warning: implicit declaration of function `FD_ZERO'
test-sys_select.c:32: error: `fds' undeclared (first use in this function)
make[4]: *** [test-sys_select.o] Error 1
On native Windows,
- <sys/socket.h> does not exist natively; gnulib provides it.
- The type fd_set and the FD_ZERO etc. macros are defined in <winsock2.h>.
Before your patch they were included via #include <sys/socket.h> which did
#include <winsock2.h>; now they are missing.
- The gnulib macro that defines HAVE_WINSOCK2_H is gl_HEADER_SYS_SOCKET or,
at least, gl_PREREQ_SYS_H_WINSOCK2. Such an invocation is fortunately still
present in m4/sys_select_h.m4.
> This is so that Emacs doesn't have to drag in m4/sockpfaf.m4
Actually nothing in module 'sys_socket' requires m4/sockpfaf.m4. Only the
modules 'inet_ntop', 'inet_pton', 'getaddrinfo' need it. But let's do this
simplification after you've fixed the 'sys_select' module. One thing after
the other.
Bruno
--
In memoriam Yuri Shchekochikhin
<http://en.wikipedia.org/wiki/Yuri_Shchekochikhin>