+2008-10-05 Bruno Haible <bruno@clisp.org>
+
+ * 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 <meyering@redhat.com>
bootstrap: check for LT_INIT more portably
# include <sys/socket.h>
-# 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
Depends-on:
include_next
+link-warning
sys_socket
sys_time
-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 $@