* configure.in: Check for h_errno declaration in netdb.h
authorTom Yu <tlyu@mit.edu>
Wed, 15 Sep 2004 20:02:31 +0000 (20:02 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 15 Sep 2004 20:02:31 +0000 (20:02 +0000)
* port-sockets.h: Explicitly declare h_errno if it's missing.

ticket: 1044

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16758 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/configure.in
src/include/port-sockets.h

index fce9d1a63508391b47ee014b06c96f8cf7df2592..f87b1864cce7d9ea902e903ed7149c48949bb651 100644 (file)
@@ -1,3 +1,9 @@
+2004-09-15  Tom Yu  <tlyu@mit.edu>
+
+       * configure.in: Check for h_errno declaration in netdb.h.
+
+       * port-sockets.h: Explicitly declare h_errno if it's missing.
+
 2004-09-10  Tom Yu  <tlyu@mit.edu>
 
        * port-sockets.h: Remove _XOPEN_SOURCE_EXTENDED hack for netdb.h,
index b50c7e4bace409b628aa50f5242f5098964af837..277f206acc21fc2e14c1d3c87291cd8743857414 100644 (file)
@@ -242,6 +242,19 @@ if test $krb5_cv_has_struct_lifconf = yes; then
 fi
 dnl
 dnl
+AC_MSG_CHECKING([for h_errno in netdb.h])
+AC_CACHE_VAL(krb5_cv_header_netdb_h_h_errno,
+[AC_TRY_COMPILE(
+       [#include <netdb.h>],
+       [int x = h_errno;], krb5_cv_header_netdb_h_h_errno=yes,
+       krb5_cv_header_netdb_h_h_errno=no)])
+AC_MSG_RESULT($krb5_cv_header_netdb_h_h_errno)
+if test $krb5_cv_header_netdb_h_h_errno = yes; then
+    AC_DEFINE([HAVE_NETDB_H_H_ERRNO], 1,
+       [Define if netdb.h declares h_errno])
+fi
+dnl
+dnl
 KRB5_AC_NEED_BIND_8_COMPAT
 dnl
 dnl
index 3154c6179e46d35e7b9f7b70feb2c4e2c69300b7..5a8562dfc8248efe0dc94f92769c0f04fd5a415e 100644 (file)
@@ -77,6 +77,10 @@ typedef WSABUF sg_buf;
 #include <arpa/inet.h>         /* For inet_ntoa */
 #include <netdb.h>
 
+#ifndef HAVE_NETDB_H_H_ERRNO
+extern int h_errno;            /* In case it's missing, e.g., HP-UX 10.20. */
+#endif
+
 #include <sys/param.h>         /* For MAXHOSTNAMELEN */
 #include <sys/socket.h>                /* For SOCK_*, AF_*, etc */
 #include <sys/time.h>          /* For struct timeval */