Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:1db7addfefc287183840d23a72123f43a3983167
Author...:karl <>
Committer:karl <>
Date.....:Sun Aug 13 13:23:53 2006 +0000
Parents..:08d3448a74a7340f6382181f1a192cb3bd04c9f8

Message
[project @ 2006-08-13 13:23:52 by karl]
gnulib update

Changes
diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am
line changes: +4/-3
index fb8b2a7..c5e7e1c
--- a/gnulib/lib/Makefile.am
+++ b/gnulib/lib/Makefile.am
@@ -8,7 +8,7 @@
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --macro-prefix=gl --assume-autoconf=2.59 closeout gettext
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl closeout gettext
 
 AUTOMAKE_OPTIONS = 1.5 gnits no-dependencies
 
@@ -17,10 +17,11 @@ noinst_LIBRARIES = libgnu.a
 libgnu_a_SOURCES =
 libgnu_a_LIBADD = @LIBOBJS@
 noinst_HEADERS =
+pkgdata_DATA =
 EXTRA_DIST =
 BUILT_SOURCES =
 SUFFIXES =
-MOSTLYCLEANFILES =
+MOSTLYCLEANFILES = core *.stackdump
 MOSTLYCLEANDIRS =
 CLEANFILES =
 DISTCLEANFILES =
@@ -75,7 +76,7 @@ libgnu_a_SOURCES += xalloc-die.c
 ## end   gnulib module xalloc-die
 
 
-mostlyclean-local:
+mostlyclean-local: mostlyclean-generic
 	@test -z "$(MOSTLYCLEANDIRS)" || \
 	  for dir in $(MOSTLYCLEANDIRS); do \
 	    if test -d $$dir; then \

diff --git a/gnulib/lib/error.c b/gnulib/lib/error.c
line changes: +74/-39
index 45698be..34e8365
--- a/gnulib/lib/error.c
+++ b/gnulib/lib/error.c
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2005, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -34,6 +34,9 @@
 #endif
 
 #ifdef _LIBC
+# include <libintl.h>
+# include <stdbool.h>
+# include <stdint.h>
 # include <wchar.h>
 # define mbsrtowcs __mbsrtowcs
 #endif
@@ -59,6 +62,7 @@ unsigned int error_message_count;
 
 # define program_name program_invocation_name
 # include <errno.h>
+# include <limits.h>
 # include <libio/libioP.h>
 
 /* In GNU libc we want do not want to use the common name `error' directly.
@@ -122,14 +126,10 @@ print_errno_message (int errnum)
 #endif
 
 #if _LIBC
-  if (_IO_fwide (stderr, 0) > 0)
-    {
-      __fwprintf (stderr, L": %s", s);
-      return;
-    }
-#endif
-
+  __fxprintf (NULL, ": %s", s);
+#else
   fprintf (stderr, ": %s", s);
+#endif
 }
 
 static void
@@ -140,26 +140,65 @@ error_tail (int status, int errnum, const char *message, va_list args)
     {
 # define ALLOCA_LIMIT 2000
       size_t len = strlen (message) + 1;
-      const wchar_t *wmessage = L"out of memory";
-      wchar_t *wbuf = (len < ALLOCA_LIMIT
-		       ? alloca (len * sizeof *wbuf)
-		       : len <= SIZE_MAX / sizeof *wbuf
-		       ? malloc (len * sizeof *wbuf)
-		       : NULL);
-
-      if (wbuf)
+      wchar_t *wmessage = NULL;
+      mbstate_t st;
+      size_t res;
+      const char *tmp;
+      bool use_malloc = false;
+
+      while (1)
 	{
-	  size_t res;
-	  mbstate_t st;
-	  const char *tmp = message;
+	  if (__libc_use_alloca (len * sizeof (wchar_t)))
+	    wmessage = (wchar_t *) alloca (len * sizeof (wchar_t));
+	  else
+	    {
+	      if (!use_malloc)
+		wmessage = NULL;
+
+	      wchar_t *p = (wchar_t *) realloc (wmessage,
+						len * sizeof (wchar_t));
+	      if (p == NULL)
+		{
+		  free (wmessage);
+		  fputws_unlocked (L"out of memory\n", stderr);
+		  return;
+		}
+	      wmessage = p;
+	      use_malloc = true;
+	    }
+
 	  memset (&st, '\0', sizeof (st));
-	  res = mbsrtowcs (wbuf, &tmp, len, &st);
-	  wmessage = res == (size_t) -1 ? L"???" : wbuf;
+	  tmp = message;
+
+	  res = mbsrtowcs (wmessage, &tmp, len, &st);
+	  if (res != len)
+	    break;
+
+	  if (__builtin_expect (len >= SIZE_MAX / 2, 0))
+	    {
+	      /* This really should not happen if everything is fine.  */
+	      res = (size_t) -1;
+	      break;
+	    }
+
+	  len *= 2;
+	}
+
+      if (res == (size_t) -1)
+	{
+	  /* The string cannot be converted.  */
+	  if (use_malloc)
+	    {
+	      free (wmessage);
+	      use_malloc = false;
+	    }
+	  wmessage = (wchar_t *) L"???";
 	}
 
       __vfwprintf (stderr, wmessage, args);
-      if (! (len < ALLOCA_LIMIT))
-	free (wbuf);
+
+      if (use_malloc)
+	free (wmessage);
     }
   else
 #endif
@@ -170,11 +209,10 @@ error_tail (int status, int errnum, const char *message, va_list args)
   if (errnum)
     print_errno_message (errnum);
 #if _LIBC
-  if (_IO_fwide (stderr, 0) > 0)
-    putwc (L'\n', stderr);
-  else
+  __fxprintf (NULL, "\n");
+#else
+  putc ('\n', stderr);
 #endif
-    putc ('\n', stderr);
   fflush (stderr);
   if (status)
     exit (status);
@@ -207,11 +245,10 @@ error (int status, int errnum, const char *message, ...)
   else
     {
 #if _LIBC
-      if (_IO_fwide (stderr, 0) > 0)
-	__fwprintf (stderr, L"%s: ", program_name);
-      else
+      __fxprintf (NULL, "%s: ", program_name);
+#else
+      fprintf (stderr, "%s: ", program_name);
 #endif
-	fprintf (stderr, "%s: ", program_name);
     }
 
   va_start (args, message);
@@ -267,21 +304,19 @@ error_at_line (int status, int errnum, const char *file_name,
   else
     {
 #if _LIBC
-      if (_IO_fwide (stderr, 0) > 0)
-	__fwprintf (stderr, L"%s: ", program_name);
-      else
+      __fxprintf (NULL, "%s:", program_name);
+#else
+      fprintf (stderr, "%s:", program_name);
 #endif
-	fprintf (stderr, "%s:", program_name);
     }
 
   if (file_name != NULL)
     {
 #if _LIBC
-      if (_IO_fwide (stderr, 0) > 0)
-	__fwprintf (stderr, L"%s:%d: ", file_name, line_number);
-      else
+      __fxprintf (NULL, "%s:%d: ", file_name, line_number);
+#else
+      fprintf (stderr, "%s:%d: ", file_name, line_number);
 #endif
-	fprintf (stderr, "%s:%d: ", file_name, line_number);
     }
 
   va_start (args, message);

diff --git a/gnulib/lib/error.h b/gnulib/lib/error.h
line changes: +2/-2
index e5220a2..5a5f247
--- a/gnulib/lib/error.h
+++ b/gnulib/lib/error.h
@@ -1,5 +1,5 @@
 /* Declaration for error-reporting function
-   Copyright (C) 1995, 1996, 1997, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 2003, 2006 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -21,7 +21,7 @@
 
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
 #  define __attribute__(Spec) /* empty */
 # endif
 /* The __-protected variants of `format' and `printf' attributes

diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4
line changes: +1/-2
index ced6683..5ce51a2
--- a/gnulib/m4/gnulib-cache.m4
+++ b/gnulib/m4/gnulib-cache.m4
@@ -15,7 +15,7 @@
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --macro-prefix=gl --assume-autoconf=2.59 closeout gettext
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --aux-dir=build-aux --no-libtool --macro-prefix=gl closeout gettext
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_MODULES([closeout gettext])
@@ -26,4 +26,3 @@ gl_DOC_BASE([doc])
 gl_TESTS_BASE([tests])
 gl_LIB([libgnu])
 gl_MACRO_PREFIX([gl])
-gl_AUTOCONF_MINVERSION([2.59])

diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4
line changes: +2/-1
index 8f7d37a..01fc8e2
--- a/gnulib/m4/gnulib-comp.m4
+++ b/gnulib/m4/gnulib-comp.m4
@@ -19,6 +19,8 @@
 # any checks for libraries, header files, types and library functions.
 AC_DEFUN([gl_EARLY],
 [
+  m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
+  m4_pattern_allow([^gl_ES$])dnl a valid locale name
   AC_REQUIRE([AC_PROG_RANLIB])
   AC_REQUIRE([AC_GNU_SOURCE])
   AC_REQUIRE([gl_LOCK])
@@ -88,7 +90,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/mbrtowc.m4
   m4/mbstate_t.m4
   m4/nls.m4
-  m4/onceonly_2_57.m4
   m4/po.m4
   m4/printf-posix.m4
   m4/progtest.m4

diff --git a/gnulib/m4/onceonly_2_57.m4 b/gnulib/m4/onceonly_2_57.m4
line changes: +0/-86
index 15884b3..0000000
--- a/gnulib/m4/onceonly_2_57.m4
+++ /dev/null
@@ -1,86 +0,0 @@
-# onceonly_2_57.m4 serial 4
-dnl Copyright (C) 2002-2003, 2005-2006 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
-dnl Public License, this file may be distributed as part of a program
-dnl that contains a configuration script generated by Autoconf, under
-dnl the same distribution terms as the rest of that program.
-
-dnl This file defines some "once only" variants of standard autoconf macros.
-dnl   AC_CHECK_HEADERS_ONCE          like  AC_CHECK_HEADERS
-dnl   AC_CHECK_FUNCS_ONCE            like  AC_CHECK_FUNCS
-dnl   AC_CHECK_DECLS_ONCE            like  AC_CHECK_DECLS
-dnl   AC_REQUIRE([AC_FUNC_STRCOLL])  like  AC_FUNC_STRCOLL
-dnl The advantage is that the check for each of the headers/functions/decls
-dnl will be put only once into the 'configure' file. It keeps the size of
-dnl the 'configure' file down, and avoids redundant output when 'configure'
-dnl is run.
-dnl The drawback is that the checks cannot be conditionalized. If you write
-dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
-dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
-dnl empty, and the check will be inserted before the body of the AC_DEFUNed
-dnl function.
-
-dnl This is like onceonly.m4, except that it uses diversions to named sections
-dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
-dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
-dnl size reduction is ca. 9%.
-
-dnl Autoconf version 2.57 or newer is recommended.
-AC_PREREQ(2.57)
-
-# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
-# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
-AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
-  :
-  AC_FOREACH([gl_HEADER_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                 [./-], [___])), [
-      m4_divert_text([INIT_PREPARE],
-        [gl_header_list="$gl_header_list gl_HEADER_NAME"])
-      gl_HEADERS_EXPANSION
-      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
-        [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
-    ])
-    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                   [./-], [___])))
-  ])
-])
-m4_define([gl_HEADERS_EXPANSION], [
-  m4_divert_text([DEFAULTS], [gl_header_list=])
-  AC_CHECK_HEADERS([$gl_header_list])
-  m4_define([gl_HEADERS_EXPANSION], [])
-])
-
-# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
-# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
-AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
-  :
-  AC_FOREACH([gl_FUNC_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
-      m4_divert_text([INIT_PREPARE],
-        [gl_func_list="$gl_func_list gl_FUNC_NAME"])
-      gl_FUNCS_EXPANSION
-      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
-        [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
-    ])
-    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
-  ])
-])
-m4_define([gl_FUNCS_EXPANSION], [
-  m4_divert_text([DEFAULTS], [gl_func_list=])
-  AC_CHECK_FUNCS([$gl_func_list])
-  m4_define([gl_FUNCS_EXPANSION], [])
-])
-
-# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
-# AC_CHECK_DECLS(DECL1, DECL2, ...).
-AC_DEFUN([AC_CHECK_DECLS_ONCE], [
-  :
-  AC_FOREACH([gl_DECL_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
-      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
-    ])
-    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
-  ])
-])

This website is licensed under AGPL-3.0. Feel free to copy!