1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00

Work around the lack of hstrerror(3) declaration on Tru64.

* configure.in: Look for the declaration of hstrerror(3).

* libguile/net_db.c: Add hstrerror(3) declaration if
  `HAVE_DECL_HSTRERROR' is undefined.
This commit is contained in:
Ludovic Courtès 2009-04-23 00:28:32 +02:00
parent df2870d385
commit d2469ca702
2 changed files with 10 additions and 2 deletions

View file

@ -734,10 +734,12 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime
# declaration is only found if `_BSD' is defined; it's marked as
# discouraged in <stdlib.h> and has type `void' instead of `int'
# anyway.
# hstrerror - on Tru64 5.1b the symbol is available in libc but the
# declaration isn't anywhere.
#
AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h)
AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv])
AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv, hstrerror])
# crypt() may or may not be available, for instance in some countries there
# are restrictions on cryptography.

View file

@ -1,5 +1,5 @@
/* "net_db.c" network database support
* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006 Free Software Foundation, Inc.
* Copyright (C) 1995,1996,1997,1998,1999,2000,2001, 2006, 2009 Free Software Foundation, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -64,6 +64,12 @@
extern int h_errno;
#endif
#if defined HAVE_HSTRERROR && !HAVE_DECL_HSTRERROR \
&& !defined __MINGW32__ && !defined __CYGWIN__
/* Some OSes, such as Tru64 5.1b, lack a declaration for hstrerror(3). */
extern const char *hstrerror (int);
#endif
SCM_SYMBOL (scm_host_not_found_key, "host-not-found");