]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Sun, 13 Apr 2008 11:16:12 +0000 (13:16 +0200)
committerSimon Josefsson <simon@josefsson.org>
Sun, 13 Apr 2008 11:16:12 +0000 (13:16 +0200)
19 files changed:
GNUmakefile
build-aux/gnupload
gl/fseeko.c
gl/getdelim.c
gl/m4/eoverflow.m4 [new file with mode: 0644]
gl/m4/gnulib-common.m4
gl/m4/gnulib-comp.m4
gl/m4/include_next.m4
lgl/gc-gnulib.c
lgl/m4/gc-random.m4
lgl/m4/gnulib-common.m4
lgl/m4/gnulib-comp.m4
lgl/m4/include_next.m4
lgl/m4/stdint.m4
lgl/m4/vasnprintf.m4
lgl/snprintf.c
lgl/vasnprintf.c
lgl/vasprintf.c
lgl/wchar.in.h

index 38dd1262fa18acfa57166a6c2837339146c2504c..0c1bc38afbd122b7b2618f1a6b03317d05f2e395 100644 (file)
@@ -54,13 +54,14 @@ _have-git-version-gen := \
   $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
 ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
   _is-dist-target = $(filter-out %clean, \
-    $(filter dist% alpha beta major,$(MAKECMDGOALS)))
+    $(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS)))
   ifneq (,$(_is-dist-target))
     _curr-ver := $(shell cd $(srcdir) && ./$(_build-aux)/git-version-gen \
                    $(srcdir)/.tarball-version)
     ifneq ($(_curr-ver),$(VERSION))
       $(info INFO: running autoreconf for new version string: $(_curr-ver))
-      _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache && $(_autoreconf)))
+      _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache .version \
+        && $(_autoreconf))
     endif
   endif
 endif
@@ -68,11 +69,16 @@ endif
 else
 
 .DEFAULT_GOAL := abort-due-to-no-makefile
+srcdir = .
 
 # The package can override .DEFAULT_GOAL to run actions like autoreconf.
 -include ./cfg.mk
 include ./maint.mk
 
+ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
+$(MAKECMDGOALS): abort-due-to-no-makefile
+endif
+
 abort-due-to-no-makefile:
        @echo There seems to be no Makefile in this directory.   1>&2
        @echo "You must run ./configure before running \`make'." 1>&2
index 2e3c8014c7d14e416dce9d4c1289666986e79e5f..6621ebd8b7f6e52596b85c7e260fff256e3603e6 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2007-12-18.17
+scriptversion=2008-04-02.19
 
-# Copyright (C) 2004, 2005, 2006, 2007  Free Software Foundation
+# Copyright (C) 2004, 2005, 2006, 2007, 2008  Free Software Foundation
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -145,7 +145,7 @@ do
        cat >$file.directive<<EOF
 version: 1.1
 directory: $destdir
-filename: $file
+filename: `basename -- "$file"`
 EOF
        echo "$passphrase" | $GPG --passphrase-fd 0 --clearsign $file.directive
         ncftpput ftp-upload.gnu.org /incoming/alpha $files $file.directive.asc
@@ -156,7 +156,7 @@ EOF
        cat >$file.directive<<EOF
 version: 1.1
 directory: $destdir
-filename: $file
+filename: `basename -- "$file"`
 EOF
        echo "$passphrase" | $GPG --passphrase-fd 0 --clearsign $file.directive
         ncftpput ftp-upload.gnu.org /incoming/ftp $files $file.directive.asc
index 0e6dfab1697377a2dd7e9ddca97e8e1bdc81e5d9..87ac92d9d99b4375f66175ac61f2ac5ba44032b3 100644 (file)
@@ -1,5 +1,5 @@
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -70,7 +70,12 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
                    ? fp->_bf._size
                    : 0)
       && fp_ub._base == NULL)
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined __EMX__               /* emx+gcc */
+  if (fp->_ptr == fp->_buffer
+      && fp->_rcount == 0
+      && fp->_wcount == 0
+      && fp->_ungetc_count == 0)
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
 # if defined __sun && defined _LP64 /* Solaris/{SPARC,AMD64} 64-bit */
 #  define fp_ ((struct { unsigned char *_ptr; \
                         unsigned char *_base; \
@@ -82,6 +87,11 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
 # else
+#  if defined _SCO_DS               /* OpenServer */
+#   define _base __base
+#   define _ptr __ptr
+#   define _cnt __cnt
+#  endif
   if (fp->_ptr == fp->_base
       && (fp->_ptr == NULL || fp->_cnt == 0))
 # endif
@@ -112,7 +122,12 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
          fp->_offset = pos;
          fp->_flags |= __SOFF;
          fp->_flags &= ~__SEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+#elif defined __EMX__               /* emx+gcc */
+          fp->_flags &= ~_IOEOF;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */
+# if defined _SCO_DS                /* OpenServer */
+#  define _flag __flag
+# endif
           fp->_flag &= ~_IOEOF;
 #endif
          return 0;
index beb131aef60b08ac6abf5c8fac3b8b4399e1aa53..3c519ccbf4cab7658e71b0ed10cf441ef4a82338 100644 (file)
@@ -1,5 +1,5 @@
 /* getdelim.c --- Implementation of replacement getdelim function.
-   Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007 Free
+   Copyright (C) 1994, 1996, 1997, 1998, 2001, 2003, 2005, 2006, 2007, 2008 Free
    Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
 # define funlockfile(x) ((void) 0)
 #endif
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 /* Read up to (and including) a DELIMITER from FP into *LINEPTR (and
    NUL-terminate it).  *LINEPTR is a pointer returned from malloc (or
    NULL), pointing to *N characters of space.  It is realloc'ed as
diff --git a/gl/m4/eoverflow.m4 b/gl/m4/eoverflow.m4
new file mode 100644 (file)
index 0000000..3bffd10
--- /dev/null
@@ -0,0 +1,70 @@
+# eoverflow.m4 serial 2
+dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX.  But some systems (like AIX 3) don't define it, and some systems
+# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+
+# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
+# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
+# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
+#    value.
+
+AC_DEFUN([gl_EOVERFLOW],
+[
+  AC_REQUIRE([AC_PROG_CC])dnl
+
+  AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
+    AC_EGREP_CPP(yes,[
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+      ], have_eoverflow=1)
+    if test -n "$have_eoverflow"; then
+      dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
+      ac_cv_decl_EOVERFLOW=yes
+    else
+      AC_EGREP_CPP(yes,[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+        ], have_eoverflow=1)
+      if test -n "$have_eoverflow"; then
+        dnl EOVERFLOW exists but is hidden.
+        dnl Define it to the same value.
+        AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+])
+      else
+        dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
+        dnl don't define it as EINVAL, because snprintf() callers want to
+        dnl distinguish EINVAL and EOVERFLOW.
+        ac_cv_decl_EOVERFLOW=E2BIG
+      fi
+    fi
+  ])
+  if test "$ac_cv_decl_EOVERFLOW" != yes; then
+    AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
+                       [Define as good substitute value for EOVERFLOW.])
+    EOVERFLOW="$ac_cv_decl_EOVERFLOW"
+    AC_SUBST(EOVERFLOW)
+  fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
index 9336d726055452aa81a4e2ceee265ce08a0deffb..3edfc120f81f9a135aeab6c15994b2327f414f1c 100644 (file)
@@ -1,9 +1,28 @@
-# gnulib-common.m4 serial 3
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 4
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+# gl_COMMON
+# is expanded unconditionally through gnulib-tool magic.
+AC_DEFUN([gl_COMMON], [
+  dnl Use AC_REQUIRE here, so that the code is expanded once only.
+  AC_REQUIRE([gl_COMMON_BODY])
+])
+AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([isoc99_inline],
+[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE_CC__ tests for the Apple compiler and its version.
+   __STDC_VERSION__ tests for the C99 mode.  */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif])
+])
+
 # gl_MODULE_INDICATOR([modulename])
 # defines a C macro indicating the presence of the given module.
 AC_DEFUN([gl_MODULE_INDICATOR],
index 4764663e90e8040c111df6943f4e52728a4d5a6f..832095bb72a2d3ca2e8061b679ba315ceec01565 100644 (file)
@@ -44,7 +44,9 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='gl'
+  gl_EOVERFLOW
   gl_HEADER_ARPA_INET
   AC_PROG_MKDIR_P
   gl_ERROR
@@ -104,6 +106,7 @@ AC_DEFUN([gl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([gltests_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gltests_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([gltests_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='gl/tests'
   m4_popdef([AC_LIBSOURCES])
   m4_popdef([AC_REPLACE_FUNCS])
@@ -232,6 +235,7 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/version-etc.c
   lib/version-etc.h
   m4/arpa_inet_h.m4
+  m4/eoverflow.m4
   m4/error.m4
   m4/extensions.m4
   m4/fseeko.m4
index 7c08e9319bf83cdb3ca6ee3b16ad679fc292fe3f..a842e2a23682bd0bea8a73ea22b58533c33ad97c 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 5
+# include_next.m4 serial 6
 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,7 +71,7 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_CHECK_HEADERS_ONCE([$1])
 
-  AC_FOREACH([gl_HEADER_NAME], [$1],
+  m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                    [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
      if test $gl_cv_have_include_next = yes; then
index ce4ff029c252dd0be810e1bb1d681845d1c15077..27fafe452bfc3229213803a66ccea5d822180332 100644 (file)
@@ -1,5 +1,5 @@
 /* gc-gnulib.c --- Common gnulib internal crypto interface functions
- * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007  Simon Josefsson
+ * Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008  Simon Josefsson
  *
  * This file is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published
 #undef open
 #undef close
 
+#ifdef GNULIB_GC_RANDOM
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  include <wincrypt.h>
+HCRYPTPROV g_hProv = 0;
+# endif
+#endif
+
 Gc_rc
 gc_init (void)
 {
+#ifdef GNULIB_GC_RANDOM
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  if(g_hProv)
+    CryptReleaseContext(g_hProv, 0);
+  CryptAcquireContext(&g_hProv, NULL, NULL, PROV_RSA_FULL, 0);
+# endif
+#endif
+
   return GC_OK;
 }
 
 void
 gc_done (void)
 {
+#ifdef GNULIB_GC_RANDOM
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  if(g_hProv)
+    {
+      CryptReleaseContext(g_hProv, 0);
+      g_hProv = 0;
+    }
+# endif
+#endif
+
   return;
 }
 
@@ -92,6 +117,11 @@ gc_done (void)
 static Gc_rc
 randomize (int level, char *data, size_t datalen)
 {
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  if(!g_hProv)
+    return GC_RANDOM_ERROR;
+  CryptGenRandom(g_hProv, (DWORD)datalen, data);
+#else
   int fd;
   const char *device;
   size_t len = 0;
@@ -140,6 +170,7 @@ randomize (int level, char *data, size_t datalen)
   rc = close (fd);
   if (rc < 0)
     return GC_RANDOM_ERROR;
+#endif
 
   return GC_OK;
 }
index e86cf6f0ec3d5491d00a0d720dc4316c1b3b29dd..c66e071314229ec8a642c9102a3343a1ab5dc372 100644 (file)
@@ -1,5 +1,5 @@
-# gc-random.m4 serial 2
-dnl Copyright (C) 2005-2007 Free Software Foundation, Inc.
+# gc-random.m4 serial 3
+dnl Copyright (C) 2005-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -39,21 +39,21 @@ AC_DEFUN([gl_GC_RANDOM],
 
   AC_MSG_CHECKING([device with (strong) random data...])
   AC_ARG_ENABLE(random-device,
-       AC_HELP_STRING([--enable-random-device],
+       AS_HELP_STRING([--enable-random-device],
                [device with (strong) randomness (for Nettle)]),
        NAME_OF_RANDOM_DEVICE=$enableval)
   AC_MSG_RESULT($NAME_OF_RANDOM_DEVICE)
 
   AC_MSG_CHECKING([device with pseudo random data...])
   AC_ARG_ENABLE(pseudo-random-device,
-       AC_HELP_STRING([--enable-pseudo-random-device],
+       AS_HELP_STRING([--enable-pseudo-random-device],
                [device with pseudo randomness (for Nettle)]),
        NAME_OF_PSEUDO_RANDOM_DEVICE=$enableval)
   AC_MSG_RESULT($NAME_OF_PSEUDO_RANDOM_DEVICE)
 
   AC_MSG_CHECKING([device with unpredictable data for nonces...])
   AC_ARG_ENABLE(nonce-device,
-       AC_HELP_STRING([--enable-nonce-device],
+       AS_HELP_STRING([--enable-nonce-device],
                [device with unpredictable nonces (for Nettle)]),
        NAME_OF_NONCE_DEVICE=$enableval)
   AC_MSG_RESULT($NAME_OF_NONCE_DEVICE)
@@ -72,7 +72,7 @@ AC_DEFUN([gl_GC_RANDOM],
         AC_MSG_WARN([[Device `$NAME_OF_NONCE_DEVICE' does not exist, consider to use --enable-nonce-device]]))
     fi
   else
-    AC_MSG_NOTICE([[Cross compiling, assuming random devices exists on the target host...]])  
+    AC_MSG_NOTICE([[Cross compiling, assuming random devices exists on the target host...]])
   fi
 
   # FIXME?: Open+read 42 bytes+close twice and compare data.  Should differ.
index 9336d726055452aa81a4e2ceee265ce08a0deffb..3edfc120f81f9a135aeab6c15994b2327f414f1c 100644 (file)
@@ -1,9 +1,28 @@
-# gnulib-common.m4 serial 3
-dnl Copyright (C) 2007 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 4
+dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+# gl_COMMON
+# is expanded unconditionally through gnulib-tool magic.
+AC_DEFUN([gl_COMMON], [
+  dnl Use AC_REQUIRE here, so that the code is expanded once only.
+  AC_REQUIRE([gl_COMMON_BODY])
+])
+AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([isoc99_inline],
+[/* Work around a bug in Apple GCC 4.0.1 build 5465: In C99 mode, it supports
+   the ISO C 99 semantics of 'extern inline' (unlike the GNU C semantics of
+   earlier versions), but does not display it by setting __GNUC_STDC_INLINE__.
+   __APPLE__ && __MACH__ test for MacOS X.
+   __APPLE_CC__ tests for the Apple compiler and its version.
+   __STDC_VERSION__ tests for the C99 mode.  */
+#if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
+# define __GNUC_STDC_INLINE__ 1
+#endif])
+])
+
 # gl_MODULE_INDICATOR([modulename])
 # defines a C macro indicating the presence of the given module.
 AC_DEFUN([gl_MODULE_INDICATOR],
index d639ebf3f3dc8427aba6a53ef60fd1dabbaebf8b..3ee744ae8f0cf22f9b6d549ad87043f46fb3e3f4 100644 (file)
@@ -38,7 +38,9 @@ AC_DEFUN([lgl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([lgl_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([lgl_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([lgl_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='lgl'
+  gl_EOVERFLOW
   gl_FUNC_ALLOCA
   gl_GC
   if test $gl_cond_libtool = false; then
@@ -133,6 +135,7 @@ AC_DEFUN([lgl_INIT],
   m4_pushdef([AC_LIBOBJ], m4_defn([lgltests_LIBOBJ]))
   m4_pushdef([AC_REPLACE_FUNCS], m4_defn([lgltests_REPLACE_FUNCS]))
   m4_pushdef([AC_LIBSOURCES], m4_defn([lgltests_LIBSOURCES]))
+  gl_COMMON
   gl_source_base='tests'
   m4_popdef([AC_LIBSOURCES])
   m4_popdef([AC_REPLACE_FUNCS])
index 7c08e9319bf83cdb3ca6ee3b16ad679fc292fe3f..a842e2a23682bd0bea8a73ea22b58533c33ad97c 100644 (file)
@@ -1,4 +1,4 @@
-# include_next.m4 serial 5
+# include_next.m4 serial 6
 dnl Copyright (C) 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -71,7 +71,7 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
   AC_REQUIRE([gl_INCLUDE_NEXT])
   AC_CHECK_HEADERS_ONCE([$1])
 
-  AC_FOREACH([gl_HEADER_NAME], [$1],
+  m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                    [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
      if test $gl_cv_have_include_next = yes; then
index bb6c34fe1e9e78a6a733f3c94501a5c240dfe947..9b5001a52d6a5b76c62de46242f90aa8292eb892 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 29
-dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
+# stdint.m4 serial 30
+dnl Copyright (C) 2001-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -240,7 +240,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to the number of bits in type ']gltype['.])])
   for gltype in $1 ; do
@@ -265,7 +265,7 @@ AC_DEFUN([gl_STDINT_BITSIZEOF],
     AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
     eval BITSIZEOF_${GLTYPE}=\$result
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
@@ -278,7 +278,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
        [Define to 1 if ']gltype[' is a signed integer type.])])
   for gltype in $1 ; do
@@ -298,7 +298,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED],
       eval HAVE_SIGNED_${GLTYPE}=0
     fi
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
 ])
 
@@ -311,7 +311,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
   dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
   dnl   config.h.in,
   dnl - extra AC_SUBST calls, so that the right substitutions are made.
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
        [Define to l, ll, u, ul, ull, etc., as suitable for
         constants of type ']gltype['.])])
@@ -350,7 +350,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
     eval ${GLTYPE}_SUFFIX=\$result
     AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
   done
-  AC_FOREACH([gltype], [$1],
+  m4_foreach_w([gltype], [$1],
     [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
 ])
 
index c4d3f4fa07187d7898b2adb76a79cdc1917be8ea..536258c06b3ccfca2192956674bfc2df9e867285 100644 (file)
@@ -1,4 +1,4 @@
-# vasnprintf.m4 serial 24
+# vasnprintf.m4 serial 25
 dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -6,7 +6,6 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_VASNPRINTF],
 [
-  AC_REQUIRE([gl_EOVERFLOW])
   AC_CHECK_FUNCS_ONCE([vasnprintf])
   if test $ac_cv_func_vasnprintf = no; then
     gl_REPLACE_VASNPRINTF
index 5c45bdc5e563c13554ec6531f6e5e9134212c62f..65434a94c1679fd1c4b4dea1328c78fcc7a12a34 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2008 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
 
 #include "vasnprintf.h"
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 /* Print formatted output to string STR.  Similar to sprintf, but
    additional length SIZE limit how much is written into STR.  Returns
    string length of formatted string (which may be larger than SIZE).
index ed579d34aa5f3327bf1f4ef8195688ca58dfbed1..ec694dfb698a477ea93e859808e135dec8095fb8 100644 (file)
 # include "fpucw.h"
 #endif
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 #if HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
@@ -3661,6 +3656,44 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                  }
 #endif
 
+               /* Decide whether to handle the precision ourselves.  */
+#if NEED_PRINTF_UNBOUNDED_PRECISION
+               switch (dp->conversion)
+                 {
+                 case 'd': case 'i': case 'u':
+                 case 'o':
+                 case 'x': case 'X': case 'p':
+                   prec_ourselves = has_precision && (precision > 0);
+                   break;
+                 default:
+                   prec_ourselves = 0;
+                   break;
+                 }
+#endif
+
+               /* Decide whether to perform the padding ourselves.  */
+#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
+               switch (dp->conversion)
+                 {
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
+                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
+                    to perform the padding after this conversion.  Functions
+                    with unistdio extensions perform the padding based on
+                    character count rather than element count.  */
+                 case 'c': case 's':
+# endif
+# if NEED_PRINTF_FLAG_ZERO
+                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+                 case 'a': case 'A':
+# endif
+                   pad_ourselves = 1;
+                   break;
+                 default:
+                   pad_ourselves = prec_ourselves;
+                   break;
+                 }
+#endif
+
 #if !USE_SNPRINTF
                /* Allocate a temporary buffer of sufficient size for calling
                   sprintf.  */
@@ -3837,18 +3870,22 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      abort ();
                    }
 
+                 if (!pad_ourselves)
+                   {
 # if ENABLE_UNISTDIO
-                 /* Padding considers the number of characters, therefore the
-                    number of elements after padding may be
-                      > max (tmp_length, width)
-                    but is certainly
-                      <= tmp_length + width.  */
-                 tmp_length = xsum (tmp_length, width);
+                     /* Padding considers the number of characters, therefore
+                        the number of elements after padding may be
+                          > max (tmp_length, width)
+                        but is certainly
+                          <= tmp_length + width.  */
+                     tmp_length = xsum (tmp_length, width);
 # else
-                 /* Padding considers the number of elements, says POSIX.  */
-                 if (tmp_length < width)
-                   tmp_length = width;
+                     /* Padding considers the number of elements,
+                        says POSIX.  */
+                     if (tmp_length < width)
+                       tmp_length = width;
 # endif
+                   }
 
                  tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
                }
@@ -3869,44 +3906,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                  }
 #endif
 
-               /* Decide whether to handle the precision ourselves.  */
-#if NEED_PRINTF_UNBOUNDED_PRECISION
-               switch (dp->conversion)
-                 {
-                 case 'd': case 'i': case 'u':
-                 case 'o':
-                 case 'x': case 'X': case 'p':
-                   prec_ourselves = has_precision && (precision > 0);
-                   break;
-                 default:
-                   prec_ourselves = 0;
-                   break;
-                 }
-#endif
-
-               /* Decide whether to perform the padding ourselves.  */
-#if !NEED_PRINTF_FLAG_LEFTADJUST && (!DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION)
-               switch (dp->conversion)
-                 {
-# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
-                 /* If we need conversion from TCHAR_T[] to DCHAR_T[], we need
-                    to perform the padding after this conversion.  Functions
-                    with unistdio extensions perform the padding based on
-                    character count rather than element count.  */
-                 case 'c': case 's':
-# endif
-# if NEED_PRINTF_FLAG_ZERO
-                 case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
-                 case 'a': case 'A':
-# endif
-                   pad_ourselves = 1;
-                   break;
-                 default:
-                   pad_ourselves = prec_ourselves;
-                   break;
-                 }
-#endif
-
                /* Construct the format string for calling snprintf or
                   sprintf.  */
                fbp = buf;
@@ -4403,14 +4402,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      }
 #endif
 
-#if !DCHAR_IS_TCHAR
-# if !USE_SNPRINTF
+#if !USE_SNPRINTF
                    if (count >= tmp_length)
                      /* tmp_length was incorrectly calculated - fix the
                         code above!  */
                      abort ();
-# endif
+#endif
 
+#if !DCHAR_IS_TCHAR
                    /* Convert from TCHAR_T[] to DCHAR_T[].  */
                    if (dp->conversion == 'c' || dp->conversion == 's')
                      {
@@ -4528,7 +4527,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                        if (w < width)
                          {
                            size_t pad = width - w;
-# if USE_SNPRINTF
+
                            /* Make room for the result.  */
                            if (xsum (count, pad) > allocated - length)
                              {
@@ -4538,12 +4537,16 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                  xmax (xsum3 (length, count, pad),
                                        xtimes (allocated, 2));
 
+# if USE_SNPRINTF
                                length += count;
                                ENSURE_ALLOCATION (n);
                                length -= count;
+# else
+                               ENSURE_ALLOCATION (n);
+# endif
                              }
                            /* Here count + pad <= allocated - length.  */
-# endif
+
                            {
 # if !DCHAR_IS_TCHAR || USE_SNPRINTF
                              DCHAR_T * const rp = result + length;
@@ -4553,7 +4556,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                              DCHAR_T *p = rp + count;
                              DCHAR_T *end = p + pad;
                              DCHAR_T *pad_ptr;
-# if !DCHAR_IS_TCHAR
+# if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO
                              if (dp->conversion == 'c'
                                  || dp->conversion == 's')
                                /* No zero-padding for string directives.  */
@@ -4604,13 +4607,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                      }
 #endif
 
-#if DCHAR_IS_TCHAR && !USE_SNPRINTF
-                   if (count >= tmp_length)
-                     /* tmp_length was incorrectly calculated - fix the
-                        code above!  */
-                     abort ();
-#endif
-
                    /* Here still count <= allocated - length.  */
 
 #if !DCHAR_IS_TCHAR || USE_SNPRINTF
index 7b645460ee8a4486052f2b6fa431badf55bce1fa..c74dc76e4f0a3342a0054e25a1689be28a36e3b4 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 
 #include "vasnprintf.h"
 
-/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
-#ifndef EOVERFLOW
-# define EOVERFLOW E2BIG
-#endif
-
 int
 vasprintf (char **resultp, const char *format, va_list args)
 {
index 0aba1cac107269fbac52a39e64d860536b300743..73588712bb7e0ec0cf355989ade6a80e2cfcf68a 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
  * the declaration of wcwidth().
  */
 
+#ifdef __need_mbstate_t
+/* Special invocation convention inside uClibc header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_WCHAR_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _GL_WCHAR_H
 
 /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
@@ -80,3 +88,4 @@ extern int wcwidth (int /* actually wchar_t */);
 
 #endif /* _GL_WCHAR_H */
 #endif /* _GL_WCHAR_H */
+#endif