summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-04-13 13:16:12 +0200
committerSimon Josefsson <simon@josefsson.org>2008-04-13 13:16:12 +0200
commit08b5febf01700db8853ff2921247c04ecd15f344 (patch)
tree92bc31a9dbce8d1ed6b1f6fee43be04f13deca57
parent0064cf575e64bf304243796cc8daf219edec5671 (diff)
downloadgnutls-08b5febf01700db8853ff2921247c04ecd15f344.tar.gz
Update gnulib files.
-rw-r--r--GNUmakefile10
-rwxr-xr-xbuild-aux/gnupload8
-rw-r--r--gl/fseeko.c21
-rw-r--r--gl/getdelim.c7
-rw-r--r--gl/m4/eoverflow.m470
-rw-r--r--gl/m4/gnulib-common.m423
-rw-r--r--gl/m4/gnulib-comp.m44
-rw-r--r--gl/m4/include_next.m44
-rw-r--r--lgl/gc-gnulib.c33
-rw-r--r--lgl/m4/gc-random.m412
-rw-r--r--lgl/m4/gnulib-common.m423
-rw-r--r--lgl/m4/gnulib-comp.m43
-rw-r--r--lgl/m4/include_next.m44
-rw-r--r--lgl/m4/stdint.m416
-rw-r--r--lgl/m4/vasnprintf.m43
-rw-r--r--lgl/snprintf.c7
-rw-r--r--lgl/vasnprintf.c126
-rw-r--r--lgl/vasprintf.c7
-rw-r--r--lgl/wchar.in.h11
19 files changed, 274 insertions, 118 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 38dd1262fa..0c1bc38afb 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -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
diff --git a/build-aux/gnupload b/build-aux/gnupload
index 2e3c8014c7..6621ebd8b7 100755
--- a/build-aux/gnupload
+++ b/build-aux/gnupload
@@ -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
diff --git a/gl/fseeko.c b/gl/fseeko.c
index 0e6dfab169..87ac92d9d9 100644
--- a/gl/fseeko.c
+++ b/gl/fseeko.c
@@ -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;
diff --git a/gl/getdelim.c b/gl/getdelim.c
index beb131aef6..3c519ccbf4 100644
--- a/gl/getdelim.c
+++ b/gl/getdelim.c
@@ -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
@@ -42,11 +42,6 @@
# 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
index 0000000000..3bffd10ed1
--- /dev/null
+++ b/gl/m4/eoverflow.m4
@@ -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])])
+])
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index 9336d72605..3edfc120f8 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -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],
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 4764663e90..832095bb72 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -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
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 7c08e9319b..a842e2a236 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -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
diff --git a/lgl/gc-gnulib.c b/lgl/gc-gnulib.c
index ce4ff029c2..27fafe452b 100644
--- a/lgl/gc-gnulib.c
+++ b/lgl/gc-gnulib.c
@@ -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
@@ -73,15 +73,40 @@
#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;
}
diff --git a/lgl/m4/gc-random.m4 b/lgl/m4/gc-random.m4
index e86cf6f0ec..c66e071314 100644
--- a/lgl/m4/gc-random.m4
+++ b/lgl/m4/gc-random.m4
@@ -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.
diff --git a/lgl/m4/gnulib-common.m4 b/lgl/m4/gnulib-common.m4
index 9336d72605..3edfc120f8 100644
--- a/lgl/m4/gnulib-common.m4
+++ b/lgl/m4/gnulib-common.m4
@@ -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],
diff --git a/lgl/m4/gnulib-comp.m4 b/lgl/m4/gnulib-comp.m4
index d639ebf3f3..3ee744ae8f 100644
--- a/lgl/m4/gnulib-comp.m4
+++ b/lgl/m4/gnulib-comp.m4
@@ -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])
diff --git a/lgl/m4/include_next.m4 b/lgl/m4/include_next.m4
index 7c08e9319b..a842e2a236 100644
--- a/lgl/m4/include_next.m4
+++ b/lgl/m4/include_next.m4
@@ -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
diff --git a/lgl/m4/stdint.m4 b/lgl/m4/stdint.m4
index bb6c34fe1e..9b5001a52d 100644
--- a/lgl/m4/stdint.m4
+++ b/lgl/m4/stdint.m4
@@ -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])])
])
diff --git a/lgl/m4/vasnprintf.m4 b/lgl/m4/vasnprintf.m4
index c4d3f4fa07..536258c06b 100644
--- a/lgl/m4/vasnprintf.m4
+++ b/lgl/m4/vasnprintf.m4
@@ -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
diff --git a/lgl/snprintf.c b/lgl/snprintf.c
index 5c45bdc5e5..65434a94c1 100644
--- a/lgl/snprintf.c
+++ b/lgl/snprintf.c
@@ -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
@@ -29,11 +29,6 @@
#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).
diff --git a/lgl/vasnprintf.c b/lgl/vasnprintf.c
index ed579d34aa..ec694dfb69 100644
--- a/lgl/vasnprintf.c
+++ b/lgl/vasnprintf.c
@@ -117,11 +117,6 @@
# 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
diff --git a/lgl/vasprintf.c b/lgl/vasprintf.c
index 7b645460ee..c74dc76e4f 100644
--- a/lgl/vasprintf.c
+++ b/lgl/vasprintf.c
@@ -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
@@ -30,11 +30,6 @@
#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)
{
diff --git a/lgl/wchar.in.h b/lgl/wchar.in.h
index 0aba1cac10..73588712bb 100644
--- a/lgl/wchar.in.h
+++ b/lgl/wchar.in.h
@@ -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
@@ -26,6 +26,14 @@
* 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