[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] socklen: do not depend on sys_socket
From: |
Bruno Haible |
Subject: |
Re: [PATCH] socklen: do not depend on sys_socket |
Date: |
Sat, 19 Mar 2011 14:49:55 +0100 |
User-agent: |
KMail/1.9.9 |
Hi Paul,
> * m4/socklen.m4 (gl_PREREQ_TYPE_SOCKLEN_T): New macro, taken from
> parts of gl_PREREQ_SYS_H_SOCKET.
> (gl_TYPE_SOCKLEN_T): Require it instead of requiring
> gl_PREREQ_SYS_H_SOCKET. Check for ws2tcpip.h only if
> sys_socket is also used.
> * m4/sys_socket_h.m4 (gl_PREREQ_SYS_H_SOCKET): Require
> gl_PREREQ_TYPE_SOCKLEN_T instead of doing its work ourselves.
> ...
> * modules/socklen: Do not depend on sys_socket.
There are two problems with this patch:
1) "Check for ws2tcpip.h only if sys_socket is also used." This is wrong
for Emacs: emacs/nt/inc/sys/socket.h does include <ws2tcpip.h>. So this
patch would cause socklen_t to be defined in config.h at configure time,
but then when Emacs code includes <sys/socket.h> which includes
<ws2tcpip.h> the declaration
typedef int socklen_t;
expands to
typedef int int;
which will lead to a compilation error.
2) If modules/socklen does not depend on sys_socket, undoing the patch of
<http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00168.html>,
then the 'Include' statement of the socklen module should be changed from
<sys/types.h>
<sys/socket.h>
to
#include <sys/types.h>
#if HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
otherwise a non-Emacs package that asks for 'socklen' but not for
'sys_socket' would get a compilation error. Also a test that defines
HAVE_SYS_SOCKET_H needs to be added, then.
Bruno
--
In memoriam Fred Scamaroni <http://fr.wikipedia.org/wiki/Fred_Scamaroni>