From: Bruno Haible Date: Sun, 5 Oct 2008 23:10:08 +0000 (+0200) Subject: Add a link warning when the 'select' module is not used. X-Git-Tag: v0.1~6891 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=e09edd140811395f660fb1e2bb50f8c58fd8f508;p=gnulib.git Add a link warning when the 'select' module is not used. --- diff --git a/ChangeLog b/ChangeLog index bbc3db52a..052772a23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-10-05 Bruno Haible + + * 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. + 2008-10-05 Jim Meyering bootstrap: check for LT_INIT more portably diff --git a/lib/sys_select.in.h b/lib/sys_select.in.h index 5a4b7a5a4..ac6002098 100644 --- a/lib/sys_select.in.h +++ b/lib/sys_select.in.h @@ -43,25 +43,31 @@ # include -# if @HAVE_WINSOCK2_H@ +/* The definition of GL_LINK_WARNING is copied here. */ -# ifdef __cplusplus +# ifdef __cplusplus extern "C" { -# endif +# endif -# if @GNULIB_SELECT@ +# 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 *); -# else -# undef select -# define select select_used_without_requesting_gnulib_module_select # 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 +# ifdef __cplusplus } -# endif - # endif #endif diff --git a/modules/sys_select b/modules/sys_select index ffb5fae85..c893e7cb8 100644 --- a/modules/sys_select +++ b/modules/sys_select @@ -7,6 +7,7 @@ m4/sys_select_h.m4 Depends-on: include_next +link-warning sys_socket sys_time @@ -29,6 +30,7 @@ sys/select.h: sys_select.in.h -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; \ } > $@-t mv $@-t $@