summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2006-06-27 18:47:37 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2006-06-27 18:47:37 +0000
commit3b373a64fe7c6cd856897a32e4834cf125797713 (patch)
tree32a5761a04a99c3810ef006c7b3291f53ad2e411
parent6a4be40e01252fe8b2911a98d6dc1767328ccb67 (diff)
downloadmailutils-3b373a64fe7c6cd856897a32e4834cf125797713.tar.gz
mailutils-3b373a64fe7c6cd856897a32e4834cf125797713.tar.bz2
Updated by gnulib-sync
-rw-r--r--lib/getpass.c8
-rw-r--r--lib/setenv.c10
-rw-r--r--lib/unsetenv.c13
-rw-r--r--lib/xalloc-die.c3
-rw-r--r--m4/argp.m422
-rw-r--r--m4/extensions.m416
-rw-r--r--m4/getlogin_r.m47
-rw-r--r--m4/getopt.m49
-rw-r--r--m4/getpass.m410
-rw-r--r--m4/longdouble.m47
-rw-r--r--m4/regex.m479
-rw-r--r--m4/setenv.m46
-rw-r--r--m4/size_max.m445
-rw-r--r--m4/ssize_t.m413
-rw-r--r--m4/stdbool.m435
-rw-r--r--m4/stdint.m4654
-rw-r--r--m4/strerror_r.m41
-rw-r--r--m4/strndup.m436
-rw-r--r--mailbox/alloca_.h26
-rw-r--r--mailbox/argp-fmtstream.c7
-rw-r--r--mailbox/argp-help.c4
-rw-r--r--mailbox/argp-parse.c10
-rw-r--r--mailbox/fnmatch.c6
-rw-r--r--mailbox/fnmatch_loop.c220
-rw-r--r--mailbox/getlogin_r.c5
-rw-r--r--mailbox/getlogin_r.h5
-rw-r--r--mailbox/getopt.c82
-rw-r--r--mailbox/glob.c21
-rw-r--r--mailbox/printf-args.c21
-rw-r--r--mailbox/regcomp.c629
-rw-r--r--mailbox/regex.c7
-rw-r--r--mailbox/regex.h510
-rw-r--r--mailbox/regex_internal.c271
-rw-r--r--mailbox/regex_internal.h195
-rw-r--r--mailbox/regexec.c669
-rw-r--r--mailbox/size_max.h6
-rw-r--r--mailbox/stdbool_.h38
-rw-r--r--mailbox/stdint_.h982
-rw-r--r--mailbox/strndup.c27
-rw-r--r--mailbox/strnlen.c27
-rw-r--r--mailbox/vasnprintf.c46
41 files changed, 3093 insertions, 1695 deletions
diff --git a/lib/getpass.c b/lib/getpass.c
index f0b3184ee..4e3339659 100644
--- a/lib/getpass.c
+++ b/lib/getpass.c
@@ -23,7 +23,7 @@
#include <stdio.h>
-#if !defined _WIN32
+#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
#include <stdbool.h>
@@ -170,13 +170,17 @@ getpass (const char *prompt)
return buf;
}
-#else /* WIN32 */
+#else /* W32 native */
/* Windows implementation by Martin Lambers <marlam@marlam.de>,
improved by Simon Josefsson. */
/* For PASS_MAX. */
#include <limits.h>
+/* For _getch(). */
+#include <conio.h>
+/* For strdup(). */
+#include <string.h>
#ifndef PASS_MAX
# define PASS_MAX 512
diff --git a/lib/setenv.c b/lib/setenv.c
index 33dbeb7a3..c607125a5 100644
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2003 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2003,2005 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
@@ -13,9 +13,9 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <alloca.h>
@@ -27,9 +27,7 @@
#include <stdlib.h>
#include <string.h>
-#if _LIBC || HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#if !_LIBC
# include "allocsa.h"
diff --git a/lib/unsetenv.c b/lib/unsetenv.c
index 4b53fc9c8..b26bd8dc9 100644
--- a/lib/unsetenv.c
+++ b/lib/unsetenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1995-1999,2000-2002 Free Software Foundation, Inc.
+/* Copyright (C) 1992,1995-1999,2000-2002,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
@@ -13,25 +13,20 @@
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
- Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#if !_LIBC
-# if !defined errno && !defined HAVE_ERRNO_DECL
-extern int errno;
-# endif
# define __set_errno(ev) ((errno) = (ev))
#endif
#include <stdlib.h>
#include <string.h>
-#if _LIBC || HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
#if !_LIBC
# define __environ environ
diff --git a/lib/xalloc-die.c b/lib/xalloc-die.c
index ff5ac9e67..9b4a76c6b 100644
--- a/lib/xalloc-die.c
+++ b/lib/xalloc-die.c
@@ -1,6 +1,6 @@
/* Report a memory allocation failure and exit.
- Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free
+ Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2006 Free
Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -30,7 +30,6 @@
#include "gettext.h"
#define _(msgid) gettext (msgid)
-#define N_(msgid) msgid
void
xalloc_die (void)
diff --git a/m4/argp.m4 b/m4/argp.m4
index 6a5d6b246..7d761ae97 100644
--- a/m4/argp.m4
+++ b/m4/argp.m4
@@ -1,5 +1,5 @@
-# argp.m4 serial 5
-dnl Copyright (C) 2003-2005 Free Software Foundation, Inc.
+# argp.m4 serial 6
+dnl Copyright (C) 2003-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.
@@ -43,11 +43,19 @@ AC_DEFUN([gl_ARGP],
AC_MSG_RESULT(yes)],
[ AC_MSG_RESULT(no)] )
- AC_CHECK_DECLS_ONCE(
- [clearerr_unlocked feof_unlocked ferror_unlocked
- fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
- fread_unlocked fwrite_unlocked getc_unlocked
- getchar_unlocked putc_unlocked putchar_unlocked])
+ AC_CHECK_DECLS_ONCE([clearerr_unlocked])
+ AC_CHECK_DECLS_ONCE([feof_unlocked])
+ AC_CHECK_DECLS_ONCE([ferror_unlocked])
+ AC_CHECK_DECLS_ONCE([fflush_unlocked])
+ AC_CHECK_DECLS_ONCE([fgets_unlocked])
+ AC_CHECK_DECLS_ONCE([fputc_unlocked])
+ AC_CHECK_DECLS_ONCE([fputs_unlocked])
+ AC_CHECK_DECLS_ONCE([fread_unlocked])
+ AC_CHECK_DECLS_ONCE([fwrite_unlocked])
+ AC_CHECK_DECLS_ONCE([getc_unlocked])
+ AC_CHECK_DECLS_ONCE([getchar_unlocked])
+ AC_CHECK_DECLS_ONCE([putc_unlocked])
+ AC_CHECK_DECLS_ONCE([putchar_unlocked])
AC_CHECK_FUNCS_ONCE([flockfile funlockfile])
AC_CHECK_HEADERS_ONCE([features.h linewrap.h])
])
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index e71845f1d..497607918 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,10 +1,13 @@
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
+# This file is only needed in autoconf <= 2.59. Newer versions of autoconf
+# have a macro AC_USE_SYSTEM_EXTENSIONS with identical semantics.
+
# gl_USE_SYSTEM_EXTENSIONS
# ------------------------
# Enable extensions on systems that normally disable them,
@@ -25,6 +28,15 @@ AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
#ifndef _POSIX_PTHREAD_SEMANTICS
# undef _POSIX_PTHREAD_SEMANTICS
#endif])
- AC_DEFINE([__EXTENSIONS__])
+ AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+ [ac_cv_safe_to_define___extensions__],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([
+ #define __EXTENSIONS__ 1
+ AC_INCLUDES_DEFAULT])],
+ [ac_cv_safe_to_define___extensions__=yes],
+ [ac_cv_safe_to_define___extensions__=no])])
+ test $ac_cv_safe_to_define___extensions__ = yes &&
+ AC_DEFINE([__EXTENSIONS__])
AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
])
diff --git a/m4/getlogin_r.m4 b/m4/getlogin_r.m4
index b90e0c275..5ad365c99 100644
--- a/m4/getlogin_r.m4
+++ b/m4/getlogin_r.m4
@@ -1,6 +1,6 @@
-#serial 1
+#serial 2
-# Copyright (C) 2005 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -29,5 +29,6 @@ AC_DEFUN([gl_GETLOGIN_R],
AC_DEFUN([gl_PREREQ_GETLOGIN_R],
[
AC_CHECK_HEADERS_ONCE([unistd.h])
- AC_CHECK_DECLS_ONCE([getlogin getlogin_r])
+ AC_CHECK_DECLS_ONCE([getlogin])
+ AC_CHECK_DECLS_ONCE([getlogin_r])
])
diff --git a/m4/getopt.m4 b/m4/getopt.m4
index c8b9171b3..e9ebae4cf 100644
--- a/m4/getopt.m4
+++ b/m4/getopt.m4
@@ -1,5 +1,5 @@
-# getopt.m4 serial 11
-dnl Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+# getopt.m4 serial 12
+dnl Copyright (C) 2002, 2003, 2004, 2005, 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.
@@ -77,4 +77,7 @@ AC_DEFUN([gl_GETOPT_IFELSE],
AC_DEFUN([gl_GETOPT], [gl_GETOPT_IFELSE([gl_GETOPT_SUBSTITUTE])])
# Prerequisites of lib/getopt*.
-AC_DEFUN([gl_PREREQ_GETOPT], [:])
+AC_DEFUN([gl_PREREQ_GETOPT],
+[
+ AC_CHECK_DECLS_ONCE([getenv])
+])
diff --git a/m4/getpass.m4 b/m4/getpass.m4
index 3d7d33bbb..ba6815f61 100644
--- a/m4/getpass.m4
+++ b/m4/getpass.m4
@@ -1,5 +1,5 @@
-# getpass.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005 Free Software Foundation, Inc.
+# getpass.m4 serial 7
+dnl Copyright (C) 2002-2003, 2005-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.
@@ -37,5 +37,9 @@ AC_DEFUN([gl_FUNC_GETPASS_GNU],
AC_DEFUN([gl_PREREQ_GETPASS], [
AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h)
AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr)
- AC_CHECK_DECLS_ONCE([fflush_unlocked flockfile fputs_unlocked funlockfile putc_unlocked])
+ AC_CHECK_DECLS_ONCE([fflush_unlocked])
+ AC_CHECK_DECLS_ONCE([flockfile])
+ AC_CHECK_DECLS_ONCE([fputs_unlocked])
+ AC_CHECK_DECLS_ONCE([funlockfile])
+ AC_CHECK_DECLS_ONCE([putc_unlocked])
])
diff --git a/m4/longdouble.m4 b/m4/longdouble.m4
index 40cd7ce02..25590f470 100644
--- a/m4/longdouble.m4
+++ b/m4/longdouble.m4
@@ -1,5 +1,5 @@
-# longdouble.m4 serial 1 (gettext-0.12)
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# longdouble.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 2002-2003, 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.
@@ -8,6 +8,9 @@ dnl From Bruno Haible.
dnl Test whether the compiler supports the 'long double' type.
dnl Prerequisite: AC_PROG_CC
+dnl This file is only needed in autoconf <= 2.59. Newer versions of autoconf
+dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
+
AC_DEFUN([gt_TYPE_LONGDOUBLE],
[
AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
diff --git a/m4/regex.m4 b/m4/regex.m4
index f296ae8a7..29abb7456 100644
--- a/m4/regex.m4
+++ b/m4/regex.m4
@@ -1,7 +1,7 @@
-#serial 31
+#serial 36
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 Free
-# Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+# 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -14,31 +14,6 @@ AC_PREREQ([2.50])
AC_DEFUN([gl_REGEX],
[
- AC_REQUIRE([AC_SYS_LARGEFILE]) dnl for a sufficently-wide off_t
-
- AC_CACHE_CHECK([whether off_t can be used in a switch statement],
- [gl_cv_type_off_t_switch],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM(
- [AC_INCLUDES_DEFAULT],
- [[off_t o = -1;
- switch (o)
- {
- case -2:
- return 1;
- case -1:
- return 2;
- default:
- return 0;
- }
- ]])],
- [gl_cv_type_off_t_switch=yes],
- [gl_cv_type_off_t_switch=no])])
- if test $gl_cv_type_off_t_switch = yes; then
- AC_DEFINE([_REGEX_LARGE_OFFSETS], 1,
- [Define if you want regoff_t to be at least as wide POSIX requires.])
- fi
-
MU_LIBSOURCES(
[regcomp.c, regex.c, regex.h,
regex_internal.c, regex_internal.h, regexec.c])
@@ -49,7 +24,7 @@ AC_DEFUN([gl_REGEX],
systems with recent-enough versions of the GNU C
Library (use with caution on other systems)])])
- case $with_included_regex in
+ case $with_included_regex in #(
yes|no) ac_use_included_regex=$with_included_regex
;;
'')
@@ -59,20 +34,24 @@ AC_DEFUN([gl_REGEX],
# regex.c. The first failing regular expression is from `Spencer ere
# test #75' in grep-2.3.
AC_CACHE_CHECK([for working re_compile_pattern],
- [gl_cv_func_re_compile_pattern_broken],
+ [gl_cv_func_re_compile_pattern_working],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM(
[AC_INCLUDES_DEFAULT
- #include <regex.h>],
+ #include <limits.h>
+ #include <regex.h>
+ ],
[[static struct re_pattern_buffer regex;
+ unsigned char folded_chars[UCHAR_MAX + 1];
+ int i;
const char *s;
struct re_registers regs;
- /* Use the POSIX-compliant spelling with leading REG_,
- rather than the traditional GNU spelling with leading RE_,
- so that we reject older libc implementations. */
- re_set_syntax (REG_SYNTAX_POSIX_EGREP);
+ re_set_syntax (RE_SYNTAX_POSIX_EGREP);
memset (&regex, 0, sizeof (regex));
- s = re_compile_pattern ("a[:@:>@:]b\n", 9, &regex);
+ for (i = 0; i <= UCHAR_MAX; i++)
+ folded_chars[i] = i;
+ regex.translate = folded_chars;
+ s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
/* This should fail with _Invalid character class name_ error. */
if (!s)
exit (1);
@@ -106,10 +85,9 @@ AC_DEFUN([gl_REGEX],
exit (1);
/* The version of regex.c in older versions of gnulib
- ignored REG_IGNORE_CASE (which was then called RE_ICASE).
- Detect that problem too. */
+ ignored RE_ICASE. Detect that problem too. */
memset (&regex, 0, sizeof (regex));
- re_set_syntax (REG_SYNTAX_EMACS | REG_IGNORE_CASE);
+ re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
s = re_compile_pattern ("x", 1, &regex);
if (s)
exit (1);
@@ -123,24 +101,29 @@ AC_DEFUN([gl_REGEX],
exit (1);
/* Reject hosts whose regoff_t values are too narrow.
- These include glibc 2.3.5 on hosts with 64-bit off_t
- and 32-bit int, and Solaris 10 on hosts with 32-bit int
- and _FILE_OFFSET_BITS=64. */
- if (sizeof (regoff_t) < sizeof (off_t))
+ These include glibc 2.3.5 on hosts with 64-bit ptrdiff_t
+ and 32-bit int. */
+ if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+ || sizeof (regoff_t) < sizeof (ssize_t))
exit (1);
exit (0);]])],
- [gl_cv_func_re_compile_pattern_broken=no],
- [gl_cv_func_re_compile_pattern_broken=yes],
- dnl When crosscompiling, assume it is broken.
- [gl_cv_func_re_compile_pattern_broken=yes])])
- ac_use_included_regex=$gl_cv_func_re_compile_pattern_broken
+ [gl_cv_func_re_compile_pattern_working=yes],
+ [gl_cv_func_re_compile_pattern_working=no],
+ dnl When crosscompiling, assume it is not working.
+ [gl_cv_func_re_compile_pattern_working=no])])
+ case $gl_cv_func_re_compile_pattern_working in #(
+ yes) ac_use_included_regex=no;; #(
+ no) ac_use_included_regex=yes;;
+ esac
;;
*) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
;;
esac
if test $ac_use_included_regex = yes; then
+ AC_DEFINE([_REGEX_LARGE_OFFSETS], 1,
+ [Define if you want regoff_t to be at least as wide POSIX requires.])
AC_DEFINE([re_syntax_options], [rpl_re_syntax_options],
[Define to rpl_re_syntax_options if the replacement should be used.])
AC_DEFINE([re_set_syntax], [rpl_re_set_syntax],
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index 4c76be1ff..623fcf2b5 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,5 +1,5 @@
-# setenv.m4 serial 5
-dnl Copyright (C) 2001-2004 Free Software Foundation, Inc.
+# setenv.m4 serial 6
+dnl Copyright (C) 2001-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.
@@ -57,7 +57,6 @@ AC_DEFUN([gl_PREREQ_SETENV],
AC_CHECK_HEADERS_ONCE(unistd.h)
AC_CHECK_HEADERS(search.h)
AC_CHECK_FUNCS(tsearch)
- gt_CHECK_VAR_DECL([#include <errno.h>], errno)
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
])
@@ -65,6 +64,5 @@ AC_DEFUN([gl_PREREQ_SETENV],
AC_DEFUN([gl_PREREQ_UNSETENV],
[
AC_CHECK_HEADERS_ONCE(unistd.h)
- gt_CHECK_VAR_DECL([#include <errno.h>], errno)
gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
])
diff --git a/m4/size_max.m4 b/m4/size_max.m4
index 0336f3af5..029e47195 100644
--- a/m4/size_max.m4
+++ b/m4/size_max.m4
@@ -1,5 +1,5 @@
-# size_max.m4 serial 3
-dnl Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# size_max.m4 serial 4
+dnl Copyright (C) 2003, 2005-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.
@@ -23,28 +23,29 @@ Found it
], result=yes)
if test -z "$result"; then
dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
- dnl than the type 'unsigned long'.
- dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
- dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
- _AC_COMPUTE_INT([(size_t)~(size_t)0 / 10], res_hi,
- [#include <stddef.h>], result=?)
- _AC_COMPUTE_INT([(size_t)~(size_t)0 % 10], res_lo,
- [#include <stddef.h>], result=?)
+ dnl than the type 'unsigned long'. Try hard to find a definition that can
+ dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+ _AC_COMPUTE_INT([sizeof (size_t) * CHAR_BIT - 1], size_t_bits_minus_1,
+ [#include <stddef.h>
+#include <limits.h>], size_t_bits_minus_1=)
_AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
- [#include <stddef.h>], result=?)
- if test "$fits_in_uint" = 1; then
- dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
- dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
- AC_TRY_COMPILE([#include <stddef.h>
- extern size_t foo;
- extern unsigned long foo;
- ], [], fits_in_uint=0)
- fi
- if test -z "$result"; then
- if test "$fits_in_uint" = 1; then
- result="$res_hi$res_lo"U
+ [#include <stddef.h>], fits_in_uint=)
+ if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+ if test $fits_in_uint = 1; then
+ dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+ dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+ AC_TRY_COMPILE([#include <stddef.h>
+ extern size_t foo;
+ extern unsigned long foo;
+ ], [], fits_in_uint=0)
+ fi
+ dnl We cannot use 'expr' to simplify this expression, because 'expr'
+ dnl works only with 'long' integers in the host environment, while we
+ dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+ if test $fits_in_uint = 1; then
+ result="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
else
- result="$res_hi$res_lo"UL
+ result="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
fi
else
dnl Shouldn't happen, but who knows...
diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4
index 19b379fee..4eaef93ce 100644
--- a/m4/ssize_t.m4
+++ b/m4/ssize_t.m4
@@ -1,5 +1,5 @@
-# ssize_t.m4 serial 3 (gettext-0.13)
-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
+# ssize_t.m4 serial 4 (gettext-0.15)
+dnl Copyright (C) 2001-2003, 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.
@@ -9,12 +9,13 @@ dnl Test whether ssize_t is defined.
AC_DEFUN([gt_TYPE_SSIZE_T],
[
- AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t,
+ AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t],
[AC_TRY_COMPILE([#include <sys/types.h>],
- [int x = sizeof (ssize_t *) + sizeof (ssize_t);],
- gt_cv_ssize_t=yes, gt_cv_ssize_t=no)])
+ [int x = sizeof (ssize_t *) + sizeof (ssize_t);
+ return !x;],
+ [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])])
if test $gt_cv_ssize_t = no; then
- AC_DEFINE(ssize_t, int,
+ AC_DEFINE([ssize_t], [int],
[Define as a signed type of the same size as size_t.])
fi
])
diff --git a/m4/stdbool.m4 b/m4/stdbool.m4
index dcb579353..2204ecd98 100644
--- a/m4/stdbool.m4
+++ b/m4/stdbool.m4
@@ -1,6 +1,6 @@
# Check for stdbool.h that conforms to C99.
-dnl Copyright (C) 2002-2005 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-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.
@@ -64,9 +64,9 @@ AC_DEFUN([AC_HEADER_STDBOOL],
char a[true == 1 ? 1 : -1];
char b[false == 0 ? 1 : -1];
char c[__bool_true_false_are_defined == 1 ? 1 : -1];
- char d[(bool) -0.5 == true ? 1 : -1];
+ char d[(bool) 0.5 == true ? 1 : -1];
bool e = &s;
- char f[(_Bool) -0.0 == false ? 1 : -1];
+ char f[(_Bool) 0.0 == false ? 1 : -1];
char g[true];
char h[sizeof (_Bool)];
char i[sizeof s.t];
@@ -74,11 +74,38 @@ AC_DEFUN([AC_HEADER_STDBOOL],
_Bool n[m];
char o[sizeof n == m * sizeof n[0] ? 1 : -1];
char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+ #if defined __xlc__ || defined __GNUC__
+ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+ reported by James Lemley on 2005-10-05; see
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+ This test is not quite right, since xlc is allowed to
+ reject this program, as the initializer for xlcbug is
+ not one of the forms that C requires support for.
+ However, doing the test right would require a run-time
+ test, and that would make cross-compilation harder.
+ Let us hope that IBM fixes the xlc bug, and also adds
+ support for this kind of constant expression. In the
+ meantime, this test will reject xlc, which is OK, since
+ our stdbool.h substitute should suffice. We also test
+ this with GCC, where it should work, to detect more
+ quickly whether someone messes up the test in the
+ future. */
+ char digs[] = "0123456789";
+ int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+ #endif
+ /* Catch a bug in an HP-UX C compiler. See
+ http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+ http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+ */
+ _Bool q = true;
+ _Bool *pq = &q;
],
[
+ *pq |= q;
+ *pq |= ! q;
/* Refer to every declared value, to avoid compiler optimizations. */
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
- + !m + !n + !o + !p);
+ + !m + !n + !o + !p + !q + !pq);
],
[ac_cv_header_stdbool_h=yes],
[ac_cv_header_stdbool_h=no])])
diff --git a/m4/stdint.m4 b/m4/stdint.m4
index d4a6994c4..e529ef3d2 100644
--- a/m4/stdint.m4
+++ b/m4/stdint.m4
@@ -1,5 +1,5 @@
-# stdint.m4 serial 5
-dnl Copyright (C) 2001-2002, 2004-2005 Free Software Foundation, Inc.
+# stdint.m4 serial 10
+dnl Copyright (C) 2001-2002, 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.
@@ -8,24 +8,59 @@ dnl From Bruno Haible.
dnl Test whether <stdint.h> is supported or must be substituted.
AC_DEFUN([gl_STDINT_H],
-[dnl Check for <inttypes.h>.
-AC_REQUIRE([gt_HEADER_INTTYPES_H])
-dnl Check for <sys/inttypes.h>.
-AC_CHECK_HEADERS([sys/inttypes.h])
-dnl Check for <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
-AC_CHECK_HEADERS([sys/bitypes.h])
-
-AC_MSG_CHECKING([for stdint.h])
-AC_CACHE_VAL(gl_cv_header_stdint_h, [
- AC_TRY_COMPILE([#include <stdint.h>], [],
- gl_cv_header_stdint_h=yes, gl_cv_header_stdint_h=no)])
-AC_MSG_RESULT([$gl_cv_header_stdint_h])
-if test $gl_cv_header_stdint_h = yes; then
- AC_DEFINE(HAVE_STDINT_H, 1,
- [Define if you have a working <stdint.h> header file.])
- STDINT_H=''
-else
- STDINT_H='stdint.h'
+[
+ dnl Check for <wchar.h>.
+ AC_CHECK_HEADERS_ONCE([wchar.h])
+ if test $ac_cv_header_wchar_h = yes; then
+ HAVE_WCHAR_H=1
+ else
+ HAVE_WCHAR_H=0
+ fi
+ AC_SUBST([HAVE_WCHAR_H])
+
+ dnl Check for <stdint.h> that doesn't clash with <sys/types.h>.
+ gl_HEADER_STDINT_H
+ if test $gl_cv_header_stdint_h = yes; then
+ ac_cv_header_stdint_h=yes; dnl Hack for gl_FULL_HEADER_PATH.
+ gl_FULL_HEADER_PATH([stdint.h])
+ FULL_PATH_STDINT_H='<'$gl_cv_full_path_stdint_h'>'
+ AC_SUBST([FULL_PATH_STDINT_H])
+ HAVE_STDINT_H=1
+ else
+ HAVE_STDINT_H=0
+ fi
+ AC_SUBST([HAVE_STDINT_H])
+
+ dnl Check for <inttypes.h> that doesn't clash with <sys/types.h>.
+ gl_HEADER_INTTYPES_H
+ if test $gl_cv_header_inttypes_h = yes; then
+ ac_cv_header_inttypes_h=yes