From bed2aeff6eae4396094c4c9336b3e77397b16dc3 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 15 Sep 2004 20:02:31 +0000 Subject: [PATCH] * configure.in: Check for h_errno declaration in netdb.h * 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 | 6 ++++++ src/include/configure.in | 13 +++++++++++++ src/include/port-sockets.h | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/src/include/ChangeLog b/src/include/ChangeLog index fce9d1a63..f87b1864c 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,9 @@ +2004-09-15 Tom Yu + + * 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 * port-sockets.h: Remove _XOPEN_SOURCE_EXTENDED hack for netdb.h, diff --git a/src/include/configure.in b/src/include/configure.in index b50c7e4ba..277f206ac 100644 --- a/src/include/configure.in +++ b/src/include/configure.in @@ -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 ], + [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 diff --git a/src/include/port-sockets.h b/src/include/port-sockets.h index 3154c6179..5a8562dfc 100644 --- a/src/include/port-sockets.h +++ b/src/include/port-sockets.h @@ -77,6 +77,10 @@ typedef WSABUF sg_buf; #include /* For inet_ntoa */ #include +#ifndef HAVE_NETDB_H_H_ERRNO +extern int h_errno; /* In case it's missing, e.g., HP-UX 10.20. */ +#endif + #include /* For MAXHOSTNAMELEN */ #include /* For SOCK_*, AF_*, etc */ #include /* For struct timeval */ -- 2.26.2