Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: use bind/netdb.h where appropriate



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@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author