+2003-10-21 Bruno Haible <bruno@clisp.org>
+
+ * canonicalize.c (lstat): Define as an alias to 'stat' on systems
+ without symbolic links.
+
2003-10-21 Bruno Haible <bruno@clisp.org>
* wait-process.c (kill): Define appropriately for native Woe32 API.
# define __getcwd(buf, max) getwd (buf)
# endif
# define __readlink readlink
+ /* On systems without symbolic links, call stat() instead of lstat(). */
+# if !defined S_ISNLK && !HAVE_READLINK
+# define lstat stat
+# endif
#endif
/* Return the canonical absolute name of file NAME. A canonical name
+2003-10-21 Bruno Haible <bruno@clisp.org>
+
+ * canonicalize.m4 (gl_PREREQ_CANONICALIZE): Also test for readlink().
+
2003-10-14 Bruno Haible <bruno@clisp.org>
* sig_atomic_t.m4: New file.
-# canonicalize.m4 serial 1 (gettext-0.12)
+# canonicalize.m4 serial 2 (gettext-0.12.2)
dnl Copyright (C) 2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
AC_DEFUN([gl_PREREQ_CANONICALIZE],
[
AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
- AC_CHECK_FUNCS(getcwd)
+ AC_CHECK_FUNCS(getcwd readlink)
])
+2003-10-21 Bruno Haible <bruno@clisp.org>
+
+ * hostname.c (xgethostname): Add support for native Woe32 API.
+
2003-10-21 Bruno Haible <bruno@clisp.org>
* message.c (message_list_search): Avoid casting a pointer to a local
# include <unistd.h>
#endif
+#ifdef WIN32
+/* Native Woe32 API lacks gethostname() but has GetComputerName() instead. */
+# include <windows.h>
+#else
/* Some systems, like early Solaris versions, lack gethostname() but
have uname() instead. */
-#if !HAVE_GETHOSTNAME
-# include <sys/utsname.h>
+# if !HAVE_GETHOSTNAME
+# include <sys/utsname.h>
+# endif
#endif
/* Get MAXHOSTNAMELEN. */
static char *
xgethostname ()
{
-#if HAVE_GETHOSTNAME
+#ifdef WIN32
+ char hostname[MAX_COMPUTERNAME_LENGTH+1];
+ DWORD size = sizeof (hostname);
+
+ if (!GetComputerName (hostname, &size))
+ error (EXIT_FAILURE, 0, _("could not get host name"));
+ return xstrdup (hostname);
+#elif HAVE_GETHOSTNAME
char hostname[MAXHOSTNAMELEN+1];
if (gethostname (hostname, MAXHOSTNAMELEN) < 0)