[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] implement full-blown select(2) for winsock
From: |
Bruno Haible |
Subject: |
Re: [PATCH] implement full-blown select(2) for winsock |
Date: |
Mon, 6 Oct 2008 01:10:31 +0200 |
User-agent: |
KMail/1.5.4 |
Paolo Bonzini wrote:
> What I meant was, having a link warning like for
> other gnulib modules would be good *even when you are not under mingw*
> (i.e. even where select works).
OK, I see. I'm adding this as a link warning conditionalized by
GNULIB_POSIXCHECK. I cannot make it unconditional, otherwise there would
be no good way to get rid of the warning for a developer who knowingly
does not want the 'select' module.
> (*) in this case, BTW, I think using module indicators would be
> better than splitting winsock.c in a zillion files.
Yes, I didn't plan to split winsock.c into pieces.
Bruno
2008-10-05 Bruno Haible <address@hidden>
* lib/sys_select.in.h: Include the GL_LINK_WARNING definition.
(select): Add a link warning when the 'select' module is not used.
* modules/sys_select (Depends-on): Add link-warning.
(Makefile.am): Substitute the definition of GL_LINK_WARNING.
Suggested by Paolo Bonzini.
*** lib/sys_select.in.h.orig 2008-10-06 01:00:14.000000000 +0200
--- lib/sys_select.in.h 2008-10-06 00:59:29.000000000 +0200
***************
*** 43,67 ****
# include <sys/socket.h>
! # if @HAVE_WINSOCK2_H@
! # ifdef __cplusplus
extern "C" {
! # endif
! # if @GNULIB_SELECT@
# undef select
# define select rpl_select
extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
- # else
- # undef select
- # define select select_used_without_requesting_gnulib_module_select
# endif
! # ifdef __cplusplus
}
- # endif
-
# endif
#endif
--- 43,73 ----
# include <sys/socket.h>
! /* The definition of GL_LINK_WARNING is copied here. */
! # ifdef __cplusplus
extern "C" {
! # endif
! # if @GNULIB_SELECT@
! # if @HAVE_WINSOCK2_H@
# undef select
# define select rpl_select
extern int rpl_select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
# endif
+ # elif @HAVE_WINSOCK2_H@
+ # undef select
+ # define select select_used_without_requesting_gnulib_module_select
+ # elif defined GNULIB_POSIXCHECK
+ # undef select
+ # define select(n,r,w,e,t) \
+ (GL_LINK_WARNING ("select is not always POSIX compliant - " \
+ "use gnulib module for portability"), \
+ select (n, r, w, e, t))
+ # endif
! # ifdef __cplusplus
}
# endif
#endif
*** modules/sys_select.orig 2008-10-06 01:00:15.000000000 +0200
--- modules/sys_select 2008-10-06 00:52:36.000000000 +0200
***************
*** 7,12 ****
--- 7,13 ----
Depends-on:
include_next
+ link-warning
sys_socket
sys_time
***************
*** 29,34 ****
--- 30,36 ----
-e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
-e 's|@''GNULIB_SELECT''@|$(GNULIB_SELECT)|g' \
-e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/sys_select.in.h; \
} > address@hidden
mv address@hidden $@