|Date:||Wed, 10 Mar 2004 16:33:51 -0600|
|From:||"Douglas E. Engert" <firstname.lastname@example.org>|
|Subject:||sane_hostname.c fails to compile on HP UX 10.20|
util/pty/sane_hostname.c failes to compile on a HP UX 10.20
as h_errno is not defined.
sane_hostname.c includes pty-int.h that includes netdb.h
Later sane_hostname.c includes fake_addrinfo.h
that defines _XOPEN_SOURCE_EXTENDED then includes netdb.h
so as to get h_errno defined. But since netdb.h was already
included the hack has no effect.
So here is hack to the hack:
*** ,fake-addrinfo.h Mon Dec 15 20:19:09 2003
--- fake-addrinfo.h Wed Mar 10 16:10:03 2004
*** 552,557 ****
--- 552,560 ----
/* Hack for HPUX, to get h_errno. */
# define _XOPEN_SOURCE_EXTENDED 1
# include <netdb.h>
+ # ifndef h_ERRNO_KT_DEFINED
+ extern int h_errno;
+ # endif
# undef _XOPEN_SOURCE_EXTENDED
On HP UX 11.0, 11.11 and 11.23 the original hack is not needed
as h_errno is defined by the first include of netdb.h. They also
define h_ERRNO_KT_DEFINED at that time, so it can be used
to test in h_errno needs to be defined in an earlier HP system.
The patch might even be reworked to not have to define
the _XOPEN_SOURCE_EXTENDED as in HP 10.20 the define is always a int.
Douglas E. Engert <DEEngert@anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439