Work around lack of cuserid(3) declaration on Tru64 5.1b.
authorLudovic Courtès <ludo@gnu.org>
Thu, 23 Apr 2009 20:24:32 +0000 (22:24 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 20 May 2009 22:09:41 +0000 (00:09 +0200)
* configure.in: Check for a cuserid(3) declaration.

* libguile/posix.c [HAVE_CUSERID][!HAVE_DECL_CUSERID]: Provide a
  declaration.

configure.in
libguile/posix.c

index 466e4d8..f06dab8 100644 (file)
@@ -736,10 +736,12 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime
 #   xlocale.h - needed on Darwin for the `locale_t' API
 #   hstrerror - on Tru64 5.1b the symbol is available in libc but the
 #       declaration isn't anywhere.
+#   cuserid - on Tru64 5.1b the declaration is documented to be available
+#       only with `_XOPEN_SOURCE' or some such.
 #
 AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h xlocale.h)
 AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname)
-AC_CHECK_DECLS([sethostname, hstrerror])
+AC_CHECK_DECLS([sethostname, hstrerror, cuserid])
 
 # crypt() may or may not be available, for instance in some countries there
 # are restrictions on cryptography.
index 78fd295..ddbaeaa 100644 (file)
@@ -1869,6 +1869,11 @@ SCM_DEFINE (scm_getlogin, "getlogin", 0, 0, 0,
 #endif /* HAVE_GETLOGIN */
 
 #if HAVE_CUSERID
+
+# if !HAVE_DECL_CUSERID
+extern char *cuserid (char *);
+# endif
+
 SCM_DEFINE (scm_cuserid, "cuserid", 0, 0, 0, 
             (void),
            "Return a string containing a user name associated with the\n"