From: Bruno Haible Date: Sat, 22 Jul 2006 16:05:56 +0000 (+0000) Subject: Update from gnulib. X-Git-Tag: 0.16.x-branchpoint~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d9d29f124600a403c0b33c7767e1df84be54ec46;p=thirdparty%2Fgettext.git Update from gnulib. --- diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog index 1e0dff69b..e3931435a 100644 --- a/gettext-tools/m4/ChangeLog +++ b/gettext-tools/m4/ChangeLog @@ -1,5 +1,7 @@ 2006-07-22 Bruno Haible + * stdbool.m4: Update from gnulib. + * minmax.m4: New file, from gnulib. * Makefile.am (EXTRA_DIST): Add it. diff --git a/gettext-tools/m4/stdbool.m4 b/gettext-tools/m4/stdbool.m4 index 3f6b4bfcb..2204ecd98 100644 --- a/gettext-tools/m4/stdbool.m4 +++ b/gettext-tools/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2004 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. @@ -28,6 +28,9 @@ AC_DEFUN([AM_STDBOOL_H], AC_SUBST([HAVE__BOOL]) ]) +# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future. +AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H]) + # This macro is only needed in autoconf <= 2.59. Newer versions of autoconf # have this macro built-in. @@ -61,19 +64,48 @@ 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]; enum { j = false, k = true, l = false * true, m = true * 256 }; _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; ], [ - return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k + !l - + !m + !n + !o); + *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 + !q + !pq); ], [ac_cv_header_stdbool_h=yes], [ac_cv_header_stdbool_h=no])]) diff --git a/gettext-tools/m4/strerror_r.m4 b/gettext-tools/m4/strerror_r.m4 index 6c6cd7f3f..e3b5d0cfd 100644 --- a/gettext-tools/m4/strerror_r.m4 +++ b/gettext-tools/m4/strerror_r.m4 @@ -1,11 +1,12 @@ -#serial 1003 +#serial 1004 +# This file is not needed if you can assume Autoconf 2.54 or later. # Experimental replacement for the function in the latest CVS autoconf. # Use with the error.c file in ../lib. -dnl Copyright 2001 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. +# Copyright (C) 2001 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. undefine([AC_FUNC_STRERROR_R]) @@ -24,6 +25,7 @@ AC_CACHE_CHECK([whether strerror_r returns char *], char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); + return !p || x; ]])], ac_cv_func_strerror_r_char_p=yes) else