]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability to mingw.
authorBruno Haible <bruno@clisp.org>
Tue, 21 Oct 2003 20:51:24 +0000 (20:51 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:05 +0000 (12:11 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/canonicalize.c
gettext-tools/m4/ChangeLog
gettext-tools/m4/canonicalize.m4
gettext-tools/src/ChangeLog
gettext-tools/src/hostname.c

index 19fb0ba87b816c8319aa4498c9db2768b665a9d7..94982caf0a7e8d2484511b6824093faa61e691c3 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 5b7713eb0a103773d6a6da86a35e39338e225043..ad796c682d2f5657d445a597b42c749a6e800ffa 100644 (file)
 #  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
index 8cdabdba75d84e8468088145ef66f2959a84c315..9116e5d968ef94e5548d9f419054992d8e5f96e1 100644 (file)
@@ -1,3 +1,7 @@
+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.
index 60f880cedccb3be39cf8e81d24a03ab6d5b48d88..57260a5ad8d69a051a7869dd630f100e2b79a4b4 100644 (file)
@@ -1,4 +1,4 @@
-# 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
@@ -23,5 +23,5 @@ AC_DEFUN([gl_CANONICALIZE],
 AC_DEFUN([gl_PREREQ_CANONICALIZE],
 [
   AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
-  AC_CHECK_FUNCS(getcwd)
+  AC_CHECK_FUNCS(getcwd readlink)
 ])
index 57270a612bfd9e1e4b5db7642a9b34e6180a42a1..7e023b41481dbf76cd47dd2e9ab510477a7aba2f 100644 (file)
@@ -1,3 +1,7 @@
+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
index 854087b6c9941615702625a2b4e16a79c1ce87d2..975508f0e8483a67f265c19ba3f2574f6b93aa9c 100644 (file)
 # 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.  */
@@ -241,7 +246,14 @@ Informative output:\n"));
 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)