zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: use bind/netdb.h where appropriate
@ 2009-02-19 10:16 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2009-02-19 10:16 UTC (permalink / raw)
  To: Zsh hackers list

I'm not sure how long this has been going on, but I'm getting warnings
from using some network utility functions.  It seems that at least
on Fedora when linked against the bind libraries we should be
including bind/netdb.h instead of netdb.h.

This will probably unleash a new tsunami of knock-on incompatibilities.

Index: configure.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.ac,v
retrieving revision 1.117
diff -u -r1.117 configure.ac
--- configure.ac	15 Jan 2009 14:49:51 -0000	1.117
+++ configure.ac	19 Feb 2009 10:12:53 -0000
@@ -755,6 +755,12 @@
 AC_CHECK_LIB(socket, socket)
 AC_CHECK_LIB(bind, gethostbyname2)
 
+case $LIBS in
+  *-lbind*)
+  AC_CHECK_HEADERS(bind/netdb.h)
+  ;;
+esac
+
 dnl ---------------
 dnl CHECK FOR ICONV
 dnl ---------------
Index: Src/Modules/tcp.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/tcp.h,v
retrieving revision 1.8
diff -u -r1.8 tcp.h
--- Src/Modules/tcp.h	28 Apr 2003 15:06:31 -0000	1.8
+++ Src/Modules/tcp.h	19 Feb 2009 10:12:54 -0000
@@ -37,7 +37,16 @@
 
 #include <sys/types.h>
 #include <sys/socket.h>
+
+#ifdef HAVE_BIND_NETDB_H
+/*
+ * On systems where we're using -lbind, this has more definitions
+ * than the standard header.
+ */
+#include <bind/netdb.h>
+#else
 #include <netdb.h>
+#endif
 
 /*
  * For some reason, configure doesn't always detect netinet/in_systm.h.


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-19 10:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-19 10:16 PATCH: use bind/netdb.h where appropriate Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).