diff --git a/.gitignore b/.gitignore index de3ba76c02..ecb8bf023f 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,3 @@ stamp-h stamp-h.in stamp-h1 update.log -TAGS diff --git a/ChangeLog b/ChangeLog index 9a5c9c8344..e06821fa15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +Tue Jan 20 21:02:53 GMT 2009 Daniel P. Berrange + + Refresh GNULIB, adding new random_r module + * bootstrap: Add random_r module + * gnulib/lib/random_r.c, gnulib/m4/random_r.m4, + gnulib/tests/test-random_r.c: New random_r module + * gnulib/lib/.cvsignore, gnulib/lib/.gitignore, gnulib/lib/Makefile.am, + gnulib/lib/arpa_inet.in.h, gnulib/lib/fseeko.c, gnulib/lib/gettimeofday.c, + gnulib/lib/ioctl.c, gnulib/lib/poll.c, gnulib/lib/stdint.in.h, + gnulib/lib/stdio.in.h, gnulib/lib/strerror.c, gnulib/lib/sys_stat.in.h, + gnulib/lib/unistd.in.h, gnulib/lib/wchar.in.h: Refresh source + * gnulib/m4/alloca.m4, gnulib/m4/codeset.m4, gnulib/m4/errno_h.m4, + gnulib/m4/getaddrinfo.m4, gnulib/m4/gethostname.m4, gnulib/m4/getline.m4, + gnulib/m4/getpass.m4, gnulib/m4/gettext.m4, gnulib/m4/gettimeofday.m4, + gnulib/m4/gnulib-cache.m4, gnulib/m4/gnulib-common.m4, + gnulib/m4/gnulib-comp.m4, gnulib/m4/iconv.m4, gnulib/m4/inet_ntop.m4, + gnulib/m4/inet_pton.m4, gnulib/m4/intldir.m4, gnulib/m4/intlmacosx.m4, + gnulib/m4/intmax.m4, gnulib/m4/intmax_t.m4, gnulib/m4/inttypes-pri.m4, + gnulib/m4/inttypes_h.m4, gnulib/m4/lcmessage.m4, gnulib/m4/lib-ld.m4, + gnulib/m4/lib-link.m4, gnulib/m4/lock.m4, gnulib/m4/longlong.m4, + gnulib/m4/lstat.m4, gnulib/m4/malloc.m4, gnulib/m4/nls.m4, + gnulib/m4/physmem.m4, gnulib/m4/po.m4, gnulib/m4/poll.m4, + gnulib/m4/printf-posix.m4, gnulib/m4/printf.m4, gnulib/m4/progtest.m4, + gnulib/m4/realloc.m4, gnulib/m4/sockets.m4, gnulib/m4/sockpfaf.m4, + gnulib/m4/stdbool.m4, gnulib/m4/stdint.m4, gnulib/m4/stdint_h.m4, + gnulib/m4/stdio_h.m4, gnulib/m4/strdup.m4, gnulib/m4/strndup.m4, + gnulib/m4/strnlen.m4, gnulib/m4/strsep.m4, gnulib/m4/threadlib.m4, + gnulib/m4/uintmax_t.m4, gnulib/m4/unistd_h.m4, gnulib/m4/vasnprintf.m4, + gnulib/m4/wchar_t.m4, gnulib/m4/wint_t.m4, gnulib/tests/Makefile.am, + gnulib/tests/test-unistd.c: Refresh macros + Tue Jan 20 20:22:53 GMT 2009 Daniel P. Berrange * src/test.c: Support domain events in test driver diff --git a/bootstrap b/bootstrap index 38dd3ae1ad..b4eed3ec39 100755 --- a/bootstrap +++ b/bootstrap @@ -81,6 +81,7 @@ physmem poll posix-shell recv +random_r send setsockopt socket diff --git a/gnulib/lib/.cvsignore b/gnulib/lib/.cvsignore index 9d6b35f849..ba817ae0b4 100644 --- a/gnulib/lib/.cvsignore +++ b/gnulib/lib/.cvsignore @@ -1,13 +1,13 @@ -*.la -*.lo -.deps -.libs -Makefile -Makefile.in alloca.h arpa_inet.h +.deps errno.h float.h +*.la +.libs +*.lo +Makefile +Makefile.in netdb.h netinet_in.h poll.h diff --git a/gnulib/lib/.gitignore b/gnulib/lib/.gitignore index 9d6b35f849..ba817ae0b4 100644 --- a/gnulib/lib/.gitignore +++ b/gnulib/lib/.gitignore @@ -1,13 +1,13 @@ -*.la -*.lo -.deps -.libs -Makefile -Makefile.in alloca.h arpa_inet.h +.deps errno.h float.h +*.la +.libs +*.lo +Makefile +Makefile.in netdb.h netinet_in.h poll.h diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am index 746881c6fe..bf558608eb 100644 --- a/gnulib/lib/Makefile.am +++ b/gnulib/lib/Makefile.am @@ -9,7 +9,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 --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify +# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell random_r recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify AUTOMAKE_OPTIONS = 1.5 gnits @@ -455,6 +455,15 @@ EXTRA_libgnu_la_SOURCES += poll.c ## end gnulib module posix-shell +## begin gnulib module random_r + + +EXTRA_DIST += random_r.c + +EXTRA_libgnu_la_SOURCES += random_r.c + +## end gnulib module random_r + ## begin gnulib module realloc-posix @@ -599,6 +608,8 @@ stdio.h: stdio.in.h -e 's|@''GNULIB_VPRINTF_POSIX''@|$(GNULIB_VPRINTF_POSIX)|g' \ -e 's|@''GNULIB_VSNPRINTF''@|$(GNULIB_VSNPRINTF)|g' \ -e 's|@''GNULIB_VSPRINTF_POSIX''@|$(GNULIB_VSPRINTF_POSIX)|g' \ + -e 's|@''GNULIB_DPRINTF''@|$(GNULIB_DPRINTF)|g' \ + -e 's|@''GNULIB_VDPRINTF''@|$(GNULIB_VDPRINTF)|g' \ -e 's|@''GNULIB_VASPRINTF''@|$(GNULIB_VASPRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF''@|$(GNULIB_OBSTACK_PRINTF)|g' \ -e 's|@''GNULIB_OBSTACK_PRINTF_POSIX''@|$(GNULIB_OBSTACK_PRINTF_POSIX)|g' \ @@ -631,6 +642,10 @@ stdio.h: stdio.in.h -e 's|@''HAVE_DECL_VSNPRINTF''@|$(HAVE_DECL_VSNPRINTF)|g' \ -e 's|@''REPLACE_SPRINTF''@|$(REPLACE_SPRINTF)|g' \ -e 's|@''REPLACE_VSPRINTF''@|$(REPLACE_VSPRINTF)|g' \ + -e 's|@''HAVE_DPRINTF''@|$(HAVE_DPRINTF)|g' \ + -e 's|@''REPLACE_DPRINTF''@|$(REPLACE_DPRINTF)|g' \ + -e 's|@''HAVE_VDPRINTF''@|$(HAVE_VDPRINTF)|g' \ + -e 's|@''REPLACE_VDPRINTF''@|$(REPLACE_VDPRINTF)|g' \ -e 's|@''HAVE_VASPRINTF''@|$(HAVE_VASPRINTF)|g' \ -e 's|@''REPLACE_VASPRINTF''@|$(REPLACE_VASPRINTF)|g' \ -e 's|@''HAVE_DECL_OBSTACK_PRINTF''@|$(HAVE_DECL_OBSTACK_PRINTF)|g' \ @@ -1064,6 +1079,7 @@ unistd.h: unistd.in.h -e 's|@''GNULIB_GETPAGESIZE''@|$(GNULIB_GETPAGESIZE)|g' \ -e 's|@''GNULIB_GETUSERSHELL''@|$(GNULIB_GETUSERSHELL)|g' \ -e 's|@''GNULIB_LCHOWN''@|$(GNULIB_LCHOWN)|g' \ + -e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \ -e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \ -e 's|@''GNULIB_READLINK''@|$(GNULIB_READLINK)|g' \ -e 's|@''GNULIB_SLEEP''@|$(GNULIB_SLEEP)|g' \ @@ -1078,6 +1094,7 @@ unistd.h: unistd.in.h -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \ -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \ -e 's|@''HAVE_GETUSERSHELL''@|$(HAVE_GETUSERSHELL)|g' \ + -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \ -e 's|@''HAVE_READLINK''@|$(HAVE_READLINK)|g' \ -e 's|@''HAVE_SLEEP''@|$(HAVE_SLEEP)|g' \ -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \ diff --git a/gnulib/lib/arpa_inet.in.h b/gnulib/lib/arpa_inet.in.h index ec5ae7223d..ba55ba2236 100644 --- a/gnulib/lib/arpa_inet.in.h +++ b/gnulib/lib/arpa_inet.in.h @@ -38,6 +38,10 @@ /* The definition of GL_LINK_WARNING is copied here. */ +#ifdef __cplusplus +extern "C" { +#endif + #if @GNULIB_INET_NTOP@ # if !@HAVE_DECL_INET_NTOP@ /* Converts an internet address from internal format to a printable, @@ -78,5 +82,9 @@ extern int inet_pton (int af, const char *restrict src, void *restrict dst); inet_pton (af, src, dst)) #endif +#ifdef __cplusplus +} +#endif + #endif /* _GL_ARPA_INET_H */ #endif /* _GL_ARPA_INET_H */ diff --git a/gnulib/lib/fseeko.c b/gnulib/lib/fseeko.c index e11e49ad1e..7ba8e58431 100644 --- a/gnulib/lib/fseeko.c +++ b/gnulib/lib/fseeko.c @@ -1,5 +1,5 @@ /* An fseeko() function that, together with fflush(), is POSIX compliant. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -86,7 +86,14 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib." #endif { - off_t pos = lseek (fileno (fp), offset, whence); + /* We get here when an fflush() call immediately preceded this one. We + know there are no buffers. + POSIX requires us to modify the file descriptor's position. + But we cannot position beyond end of file here. */ + off_t pos = + lseek (fileno (fp), + whence == SEEK_END && offset > 0 ? 0 : offset, + whence); if (pos == -1) { #if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ @@ -94,20 +101,22 @@ rpl_fseeko (FILE *fp, off_t offset, int whence) #endif return -1; } - else - { -#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ - fp_->_offset = pos; - fp_->_flags |= __SOFF; - fp_->_flags &= ~__SEOF; + +#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */ + fp->_flags &= ~_IO_EOF_SEEN; +#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, MacOS X, Cygwin */ + fp_->_offset = pos; + fp_->_flags |= __SOFF; + fp_->_flags &= ~__SEOF; #elif defined __EMX__ /* emx+gcc */ - fp->_flags &= ~_IOEOF; + fp->_flags &= ~_IOEOF; #elif defined _IOERR /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw */ - fp->_flag &= ~_IOEOF; + fp->_flag &= ~_IOEOF; #endif - return 0; - } + /* If we were not requested to position beyond end of file, we're + done. */ + if (!(whence == SEEK_END && offset > 0)) + return 0; } - else - return fseeko (fp, offset, whence); + return fseeko (fp, offset, whence); } diff --git a/gnulib/lib/gettimeofday.c b/gnulib/lib/gettimeofday.c index 75339c46a1..abe290449e 100644 --- a/gnulib/lib/gettimeofday.c +++ b/gnulib/lib/gettimeofday.c @@ -41,6 +41,12 @@ static struct tm tm_zero_buffer; static struct tm *localtime_buffer_addr = &tm_zero_buffer; +#undef localtime +extern struct tm *localtime (time_t const *); + +#undef gmtime +extern struct tm *gmtime (time_t const *); + /* This is a wrapper for localtime. It is used only on systems for which gettimeofday clobbers the static buffer used for localtime's result. @@ -50,8 +56,6 @@ static struct tm *localtime_buffer_addr = &tm_zero_buffer; struct tm * rpl_localtime (time_t const *timep) { -#undef localtime - extern struct tm *localtime (time_t const *); struct tm *tm = localtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -64,8 +68,6 @@ rpl_localtime (time_t const *timep) struct tm * rpl_gmtime (time_t const *timep) { -#undef gmtime - extern struct tm *gmtime (time_t const *); struct tm *tm = gmtime (timep); if (localtime_buffer_addr == &tm_zero_buffer) @@ -77,14 +79,15 @@ rpl_gmtime (time_t const *timep) #endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */ #if TZSET_CLOBBERS_LOCALTIME + +#undef tzset +extern void tzset (void); + /* This is a wrapper for tzset, for systems on which tzset may clobber the static buffer used for localtime's result. */ void rpl_tzset (void) { -#undef tzset - extern void tzset (void); - /* Save and restore the contents of the buffer used for localtime's result around the call to tzset. */ struct tm save = *localtime_buffer_addr; diff --git a/gnulib/lib/ioctl.c b/gnulib/lib/ioctl.c index 77e01015d4..1c2d73a841 100644 --- a/gnulib/lib/ioctl.c +++ b/gnulib/lib/ioctl.c @@ -1,6 +1,6 @@ /* ioctl.c --- wrappers for Windows ioctl function - Copyright (C) 2008 Free Software Foundation, Inc. + Copyright (C) 2008, 2009 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 @@ -19,6 +19,8 @@ #include +#include + #include #define WIN32_LEAN_AND_MEAN diff --git a/gnulib/lib/poll.c b/gnulib/lib/poll.c index da9c9f2942..ae4f4b5e94 100644 --- a/gnulib/lib/poll.c +++ b/gnulib/lib/poll.c @@ -19,6 +19,11 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +/* Tell gcc not to warn about the (nfd < 0) tests, below. */ +#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__ +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif + #include #include @@ -404,7 +409,6 @@ poll (pfd, nfd, timeout) fd_set rfds, wfds, xfds; BOOL poll_again; MSG msg; - char sockbuf[256]; int rc = 0; nfds_t i; @@ -426,7 +430,6 @@ poll (pfd, nfd, timeout) /* Classify socket handles and create fd sets. */ for (i = 0; i < nfd; i++) { - size_t optlen = sizeof(sockbuf); pfd[i].revents = 0; if (pfd[i].fd < 0) continue; diff --git a/gnulib/lib/random_r.c b/gnulib/lib/random_r.c new file mode 100644 index 0000000000..3b1d4b6f16 --- /dev/null +++ b/gnulib/lib/random_r.c @@ -0,0 +1,420 @@ +/* + Copyright (C) 1995, 2005, 2008 Free Software Foundation + + The GNU C Library 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 Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA + 02111-1307 USA. */ + +/* + Copyright (C) 1983 Regents of the University of California. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 4. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE.*/ + +/* + * This is derived from the Berkeley source: + * @(#)random.c 5.5 (Berkeley) 7/6/88 + * It was reworked for the GNU C Library by Roland McGrath. + * Rewritten to be reentrant by Ulrich Drepper, 1995 + */ + +#include + +#include +#include +#include +#include +#include + + +/* An improved random number generation package. In addition to the standard + rand()/srand() like interface, this package also has a special state info + interface. The initstate() routine is called with a seed, an array of + bytes, and a count of how many bytes are being passed in; this array is + then initialized to contain information for random number generation with + that much state information. Good sizes for the amount of state + information are 32, 64, 128, and 256 bytes. The state can be switched by + calling the setstate() function with the same array as was initialized + with initstate(). By default, the package runs with 128 bytes of state + information and generates far better random numbers than a linear + congruential generator. If the amount of state information is less than + 32 bytes, a simple linear congruential R.N.G. is used. Internally, the + state information is treated as an array of longs; the zeroth element of + the array is the type of R.N.G. being used (small integer); the remainder + of the array is the state information for the R.N.G. Thus, 32 bytes of + state information will give 7 longs worth of state information, which will + allow a degree seven polynomial. (Note: The zeroth word of state + information also has some other information stored in it; see setstate + for details). The random number generation technique is a linear feedback + shift register approach, employing trinomials (since there are fewer terms + to sum up that way). In this approach, the least significant bit of all + the numbers in the state table will act as a linear feedback shift register, + and will have period 2^deg - 1 (where deg is the degree of the polynomial + being used, assuming that the polynomial is irreducible and primitive). + The higher order bits will have longer periods, since their values are + also influenced by pseudo-random carries out of the lower bits. The + total period of the generator is approximately deg*(2**deg - 1); thus + doubling the amount of state information has a vast influence on the + period of the generator. Note: The deg*(2**deg - 1) is an approximation + only good for large deg, when the period of the shift register is the + dominant factor. With deg equal to seven, the period is actually much + longer than the 7*(2**7 - 1) predicted by this formula. */ + + + +/* For each of the currently supported random number generators, we have a + break value on the amount of state information (you need at least this many + bytes of state info to support this random number generator), a degree for + the polynomial (actually a trinomial) that the R.N.G. is based on, and + separation between the two lower order coefficients of the trinomial. */ + +/* Linear congruential. */ +#define TYPE_0 0 +#define BREAK_0 8 +#define DEG_0 0 +#define SEP_0 0 + +/* x**7 + x**3 + 1. */ +#define TYPE_1 1 +#define BREAK_1 32 +#define DEG_1 7 +#define SEP_1 3 + +/* x**15 + x + 1. */ +#define TYPE_2 2 +#define BREAK_2 64 +#define DEG_2 15 +#define SEP_2 1 + +/* x**31 + x**3 + 1. */ +#define TYPE_3 3 +#define BREAK_3 128 +#define DEG_3 31 +#define SEP_3 3 + +/* x**63 + x + 1. */ +#define TYPE_4 4 +#define BREAK_4 256 +#define DEG_4 63 +#define SEP_4 1 + + +/* Array versions of the above information to make code run faster. + Relies on fact that TYPE_i == i. */ + +#define MAX_TYPES 5 /* Max number of types above. */ + +struct random_poly_info +{ + int seps[MAX_TYPES]; + int degrees[MAX_TYPES]; +}; + +static const struct random_poly_info random_poly_info = +{ + { SEP_0, SEP_1, SEP_2, SEP_3, SEP_4 }, + { DEG_0, DEG_1, DEG_2, DEG_3, DEG_4 } +}; + +#ifndef _LIBC +# define weak_alias(local, symbol) +# define __set_errno(e) errno = (e) +# define __srandom_r srandom_r +# define __initstate_r initstate_r +# define __setstate_r setstate_r +# define __random_r random_r +#endif + + + +/* Initialize the random number generator based on the given seed. If the + type is the trivial no-state-information type, just remember the seed. + Otherwise, initializes state[] based on the given "seed" via a linear + congruential generator. Then, the pointers are set to known locations + that are exactly rand_sep places apart. Lastly, it cycles the state + information a given number of times to get rid of any initial dependencies + introduced by the L.C.R.N.G. Note that the initialization of randtbl[] + for default usage relies on values produced by this routine. */ +int +__srandom_r (unsigned int seed, struct random_data *buf) +{ + int type; + int32_t *state; + long int i; + long int word; + int32_t *dst; + int kc; + + if (buf == NULL) + goto fail; + type = buf->rand_type; + if ((unsigned int) type >= MAX_TYPES) + goto fail; + + state = buf->state; + /* We must make sure the seed is not 0. Take arbitrarily 1 in this case. */ + if (seed == 0) + seed = 1; + state[0] = seed; + if (type == TYPE_0) + goto done; + + dst = state; + word = seed; + kc = buf->rand_deg; + for (i = 1; i < kc; ++i) + { + /* This does: + state[i] = (16807 * state[i - 1]) % 2147483647; + but avoids overflowing 31 bits. */ + long int hi = word / 127773; + long int lo = word % 127773; + word = 16807 * lo - 2836 * hi; + if (word < 0) + word += 2147483647; + *++dst = word; + } + + buf->fptr = &state[buf->rand_sep]; + buf->rptr = &state[0]; + kc *= 10; + while (--kc >= 0) + { + int32_t discard; + (void) __random_r (buf, &discard); + } + + done: + return 0; + + fail: + return -1; +} + +weak_alias (__srandom_r, srandom_r) + +/* Initialize the state information in the given array of N bytes for + future random number generation. Based on the number of bytes we + are given, and the break values for the different R.N.G.'s, we choose + the best (largest) one we can and set things up for it. srandom is + then called to initialize the state information. Note that on return + from srandom, we set state[-1] to be the type multiplexed with the current + value of the rear pointer; this is so successive calls to initstate won't + lose this information and will be able to restart with setstate. + Note: The first thing we do is save the current state, if any, just like + setstate so that it doesn't matter when initstate is called. + Returns a pointer to the old state. */ +int +__initstate_r (unsigned int seed, char *arg_state, size_t n, + struct random_data *buf) +{ + int32_t *old_state; + int32_t *state; + int type; + int degree; + int separation; + + if (buf == NULL) + goto fail; + + old_state = buf->state; + if (old_state != NULL) + { + int old_type = buf->rand_type; + if (old_type == TYPE_0) + old_state[-1] = TYPE_0; + else + old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type; + } + + if (n >= BREAK_3) + type = n < BREAK_4 ? TYPE_3 : TYPE_4; + else if (n < BREAK_1) + { + if (n < BREAK_0) + { + __set_errno (EINVAL); + goto fail; + } + type = TYPE_0; + } + else + type = n < BREAK_2 ? TYPE_1 : TYPE_2; + + degree = random_poly_info.degrees[type]; + separation = random_poly_info.seps[type]; + + buf->rand_type = type; + buf->rand_sep = separation; + buf->rand_deg = degree; + state = &((int32_t *) arg_state)[1]; /* First location. */ + /* Must set END_PTR before srandom. */ + buf->end_ptr = &state[degree]; + + buf->state = state; + + __srandom_r (seed, buf); + + state[-1] = TYPE_0; + if (type != TYPE_0) + state[-1] = (buf->rptr - state) * MAX_TYPES + type; + + return 0; + + fail: + __set_errno (EINVAL); + return -1; +} + +weak_alias (__initstate_r, initstate_r) + +/* Restore the state from the given state array. + Note: It is important that we also remember the locations of the pointers + in the current state information, and restore the locations of the pointers + from the old state information. This is done by multiplexing the pointer + location into the zeroth word of the state information. Note that due + to the order in which things are done, it is OK to call setstate with the + same state as the current state + Returns a pointer to the old state information. */ +int +__setstate_r (char *arg_state, struct random_data *buf) +{ + int32_t *new_state = 1 + (int32_t *) arg_state; + int type; + int old_type; + int32_t *old_state; + int degree; + int separation; + + if (arg_state == NULL || buf == NULL) + goto fail; + + old_type = buf->rand_type; + old_state = buf->state; + if (old_type == TYPE_0) + old_state[-1] = TYPE_0; + else + old_state[-1] = (MAX_TYPES * (buf->rptr - old_state)) + old_type; + + type = new_state[-1] % MAX_TYPES; + if (type < TYPE_0 || type > TYPE_4) + goto fail; + + buf->rand_deg = degree = random_poly_info.degrees[type]; + buf->rand_sep = separation = random_poly_info.seps[type]; + buf->rand_type = type; + + if (type != TYPE_0) + { + int rear = new_state[-1] / MAX_TYPES; + buf->rptr = &new_state[rear]; + buf->fptr = &new_state[(rear + separation) % degree]; + } + buf->state = new_state; + /* Set end_ptr too. */ + buf->end_ptr = &new_state[degree]; + + return 0; + + fail: + __set_errno (EINVAL); + return -1; +} + +weak_alias (__setstate_r, setstate_r) + +/* If we are using the trivial TYPE_0 R.N.G., just do the old linear + congruential bit. Otherwise, we do our fancy trinomial stuff, which is the + same in all the other cases due to all the global variables that have been + set up. The basic operation is to add the number at the rear pointer into + the one at the front pointer. Then both pointers are advanced to the next + location cyclically in the table. The value returned is the sum generated, + reduced to 31 bits by throwing away the "least random" low bit. + Note: The code takes advantage of the fact that both the front and + rear pointers can't wrap on the same call by not testing the rear + pointer if the front one has wrapped. Returns a 31-bit random number. */ + +int +__random_r (struct random_data *buf, int32_t *result) +{ + int32_t *state; + + if (buf == NULL || result == NULL) + goto fail; + + state = buf->state; + + if (buf->rand_type == TYPE_0) + { + int32_t val = state[0]; + val = ((state[0] * 1103515245) + 12345) & 0x7fffffff; + state[0] = val; + *result = val; + } + else + { + int32_t *fptr = buf->fptr; + int32_t *rptr = buf->rptr; + int32_t *end_ptr = buf->end_ptr; + int32_t val; + + val = *fptr += *rptr; + /* Chucking least random bit. */ + *result = (val >> 1) & 0x7fffffff; + ++fptr; + if (fptr >= end_ptr) + { + fptr = state; + ++rptr; + } + else + { + ++rptr; + if (rptr >= end_ptr) + rptr = state; + } + buf->fptr = fptr; + buf->rptr = rptr; + } + return 0; + + fail: + __set_errno (EINVAL); + return -1; +} + +weak_alias (__random_r, random_r) diff --git a/gnulib/lib/stdint.in.h b/gnulib/lib/stdint.in.h index 51ac462d95..7cbfc2cf7e 100644 --- a/gnulib/lib/stdint.in.h +++ b/gnulib/lib/stdint.in.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001-2002, 2004-2008 Free Software Foundation, Inc. +/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. This file is part of gnulib. @@ -478,7 +478,9 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - includes -> -> -> , and the latter includes and assumes its types are already defined. */ #if ! (defined WCHAR_MIN && defined WCHAR_MAX) +# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H # include +# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H #endif #undef WCHAR_MIN #undef WCHAR_MAX diff --git a/gnulib/lib/stdio.in.h b/gnulib/lib/stdio.in.h index 3b61879cda..6610fed54b 100644 --- a/gnulib/lib/stdio.in.h +++ b/gnulib/lib/stdio.in.h @@ -216,6 +216,38 @@ extern int vsprintf (char *str, const char *format, va_list args) vsprintf (b, f, a)) #endif +#if @GNULIB_DPRINTF@ +# if @REPLACE_DPRINTF@ +# define dprintf rpl_dprintf +# endif +# if @REPLACE_DPRINTF@ || !@HAVE_DPRINTF@ +extern int dprintf (int fd, const char *format, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef dprintf +# define dprintf(d,f,a) \ + (GL_LINK_WARNING ("dprintf is unportable - " \ + "use gnulib module dprintf for portability"), \ + dprintf (d, f, a)) +#endif + +#if @GNULIB_VDPRINTF@ +# if @REPLACE_VDPRINTF@ +# define vdprintf rpl_vdprintf +# endif +# if @REPLACE_VDPRINTF@ || !@HAVE_VDPRINTF@ +extern int vdprintf (int fd, const char *format, va_list args) + __attribute__ ((__format__ (__printf__, 2, 0))); +# endif +#elif defined GNULIB_POSIXCHECK +# undef vdprintf +# define vdprintf(d,f,a) \ + (GL_LINK_WARNING ("vdprintf is unportable - " \ + "use gnulib module vdprintf for portability"), \ + vdprintf (d, f, a)) +#endif + #if @GNULIB_VASPRINTF@ # if @REPLACE_VASPRINTF@ # define asprintf rpl_asprintf diff --git a/gnulib/lib/strerror.c b/gnulib/lib/strerror.c index a8e98be972..2fc7284526 100644 --- a/gnulib/lib/strerror.c +++ b/gnulib/lib/strerror.c @@ -1,6 +1,6 @@ /* strerror.c --- POSIX compatible system error routine - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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 @@ -40,94 +40,133 @@ char * rpl_strerror (int n) { + char const *msg = NULL; /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ switch (n) { # if GNULIB_defined_ETXTBSY case ETXTBSY: - return "Text file busy"; + msg = "Text file busy"; + break; # endif # if GNULIB_defined_ESOCK /* native Windows platforms */ /* EWOULDBLOCK is the same as EAGAIN. */ case EINPROGRESS: - return "Operation now in progress"; + msg = "Operation now in progress"; + break; case EALREADY: - return "Operation already in progress"; + msg = "Operation already in progress"; + break; case ENOTSOCK: - return "Socket operation on non-socket"; + msg = "Socket operation on non-socket"; + break; case EDESTADDRREQ: - return "Destination address required"; + msg = "Destination address required"; + break; case EMSGSIZE: - return "Message too long"; + msg = "Message too long"; + break; case EPROTOTYPE: - return "Protocol wrong type for socket"; + msg = "Protocol wrong type for socket"; + break; case ENOPROTOOPT: - return "Protocol not available"; + msg = "Protocol not available"; + break; case EPROTONOSUPPORT: - return "Protocol not supported"; + msg = "Protocol not supported"; + break; case ESOCKTNOSUPPORT: - return "Socket type not supported"; + msg = "Socket type not supported"; + break; case EOPNOTSUPP: - return "Operation not supported"; + msg = "Operation not supported"; + break; case EPFNOSUPPORT: - return "Protocol family not supported"; + msg = "Protocol family not supported"; + break; case EAFNOSUPPORT: - return "Address family not supported by protocol"; + msg = "Address family not supported by protocol"; + break; case EADDRINUSE: - return "Address already in use"; + msg = "Address already in use"; + break; case EADDRNOTAVAIL: - return "Cannot assign requested address"; + msg = "Cannot assign requested address"; + break; case ENETDOWN: - return "Network is down"; + msg = "Network is down"; + break; case ENETUNREACH: - return "Network is unreachable"; + msg = "Network is unreachable"; + break; case ENETRESET: - return "Network dropped connection on reset"; + msg = "Network dropped connection on reset"; + break; case ECONNABORTED: - return "Software caused connection abort"; + msg = "Software caused connection abort"; + break; case ECONNRESET: - return "Connection reset by peer"; + msg = "Connection reset by peer"; + break; case ENOBUFS: - return "No buffer space available"; + msg = "No buffer space available"; + break; case EISCONN: - return "Transport endpoint is already connected"; + msg = "Transport endpoint is already connected"; + break; case ENOTCONN: - return "Transport endpoint is not connected"; + msg = "Transport endpoint is not connected"; + break; case ESHUTDOWN: - return "Cannot send after transport endpoint shutdown"; + msg = "Cannot send after transport endpoint shutdown"; + break; case ETOOMANYREFS: - return "Too many references: cannot splice"; + msg = "Too many references: cannot splice"; + break; case ETIMEDOUT: - return "Connection timed out"; + msg = "Connection timed out"; + break; case ECONNREFUSED: - return "Connection refused"; + msg = "Connection refused"; + break; case ELOOP: - return "Too many levels of symbolic links"; + msg = "Too many levels of symbolic links"; + break; case EHOSTDOWN: - return "Host is down"; + msg = "Host is down"; + break; case EHOSTUNREACH: - return "No route to host"; + msg = "No route to host"; + break; case EPROCLIM: - return "Too many processes"; + msg = "Too many processes"; + break; case EUSERS: - return "Too many users"; + msg = "Too many users"; + break; case EDQUOT: - return "Disk quota exceeded"; + msg = "Disk quota exceeded"; + break; case ESTALE: - return "Stale NFS file handle"; + msg = "Stale NFS file handle"; + break; case EREMOTE: - return "Object is remote"; + msg = "Object is remote"; + break; # if HAVE_WINSOCK2_H /* WSA_INVALID_HANDLE maps to EBADF */ /* WSA_NOT_ENOUGH_MEMORY maps to ENOMEM */ /* WSA_INVALID_PARAMETER maps to EINVAL */ case WSA_OPERATION_ABORTED: - return "Overlapped operation aborted"; + msg = "Overlapped operation aborted"; + break; case WSA_IO_INCOMPLETE: - return "Overlapped I/O event object not in signaled state"; + msg = "Overlapped I/O event object not in signaled state"; + break; case WSA_IO_PENDING: - return "Overlapped operations will complete later"; + msg = "Overlapped operations will complete later"; + break; /* WSAEINTR maps to EINTR */ /* WSAEBADF maps to EBADF */ /* WSAEACCES maps to EACCES */ @@ -172,98 +211,127 @@ rpl_strerror (int n) /* WSAESTALE is ESTALE */ /* WSAEREMOTE is EREMOTE */ case WSASYSNOTREADY: - return "Network subsystem is unavailable"; + msg = "Network subsystem is unavailable"; + break; case WSAVERNOTSUPPORTED: - return "Winsock.dll version out of range"; + msg = "Winsock.dll version out of range"; + break; case WSANOTINITIALISED: - return "Successful WSAStartup not yet performed"; + msg = "Successful WSAStartup not yet performed"; + break; case WSAEDISCON: - return "Graceful shutdown in progress"; + msg = "Graceful shutdown in progress"; + break; case WSAENOMORE: case WSA_E_NO_MORE: - return "No more results"; + msg = "No more results"; + break; case WSAECANCELLED: case WSA_E_CANCELLED: - return "Call was canceled"; + msg = "Call was canceled"; + break; case WSAEINVALIDPROCTABLE: - return "Procedure call table is invalid"; + msg = "Procedure call table is invalid"; + break; case WSAEINVALIDPROVIDER: - return "Service provider is invalid"; + msg = "Service provider is invalid"; + break; case WSAEPROVIDERFAILEDINIT: - return "Service provider failed to initialize"; + msg = "Service provider failed to initialize"; + break; case WSASYSCALLFAILURE: - return "System call failure"; + msg = "System call failure"; + break; case WSASERVICE_NOT_FOUND: - return "Service not found"; + msg = "Service not found"; + break; case WSATYPE_NOT_FOUND: - return "Class type not found"; + msg = "Class type not found"; + break; case WSAEREFUSED: - return "Database query was refused"; + msg = "Database query was refused"; + break; case WSAHOST_NOT_FOUND: - return "Host not found"; + msg = "Host not found"; + break; case WSATRY_AGAIN: - return "Nonauthoritative host not found"; + msg = "Nonauthoritative host not found"; + break; case WSANO_RECOVERY: - return "Nonrecoverable error"; + msg = "Nonrecoverable error"; + break; case WSANO_DATA: - return "Valid name, no data record of requested type"; + msg = "Valid name, no data record of requested type"; + break; /* WSA_QOS_* omitted */ # endif # endif # if GNULIB_defined_ENOMSG case ENOMSG: - return "No message of desired type"; + msg = "No message of desired type"; + break; # endif # if GNULIB_defined_EIDRM case EIDRM: - return "Identifier removed"; + msg = "Identifier removed"; + break; # endif # if GNULIB_defined_ENOLINK case ENOLINK: - return "Link has been severed"; + msg = "Link has been severed"; + break; # endif # if GNULIB_defined_EPROTO case EPROTO: - return "Protocol error"; + msg = "Protocol error"; + break; # endif # if GNULIB_defined_EMULTIHOP case EMULTIHOP: - return "Multihop attempted"; + msg = "Multihop attempted"; + break; # endif # if GNULIB_defined_EBADMSG case EBADMSG: - return "Bad message"; + msg = "Bad message"; + break; # endif # if GNULIB_defined_EOVERFLOW case EOVERFLOW: - return "Value too large for defined data type"; + msg = "Value too large for defined data type"; + break; # endif # if GNULIB_defined_ENOTSUP case ENOTSUP: - return "Not supported"; + msg = "Not supported"; + break; # endif # if GNULIB_defined_ case ECANCELED: - return "Operation canceled"; + msg = "Operation canceled"; + break; # endif } + if (msg) + return (char *) msg; + { char *result = strerror (n); if (result == NULL || result[0] == '\0') { static char const fmt[] = "Unknown error (%d)"; - static char mesg[sizeof fmt + INT_STRLEN_BOUND (n)]; - sprintf (mesg, fmt, n); - return mesg; + static char msg_buf[sizeof fmt + INT_STRLEN_BOUND (n)]; + sprintf (msg_buf, fmt, n); + return msg_buf; } return result; diff --git a/gnulib/lib/sys_stat.in.h b/gnulib/lib/sys_stat.in.h index f46b4d77e9..c20df22bd1 100644 --- a/gnulib/lib/sys_stat.in.h +++ b/gnulib/lib/sys_stat.in.h @@ -1,5 +1,5 @@ /* Provide a more complete sys/stat header file. - Copyright (C) 2005-2008 Free Software Foundation, Inc. + Copyright (C) 2005-2009 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 @@ -35,6 +35,9 @@ #ifndef _GL_SYS_STAT_H +/* Get nlink_t. */ +#include + /* The include_next requires a split double-inclusion guard. */ #@INCLUDE_NEXT@ @NEXT_SYS_STAT_H@ diff --git a/gnulib/lib/unistd.in.h b/gnulib/lib/unistd.in.h index 4b6c4b901e..c1a2d2ba99 100644 --- a/gnulib/lib/unistd.in.h +++ b/gnulib/lib/unistd.in.h @@ -1,5 +1,5 @@ /* Substitute for and wrapper around . - Copyright (C) 2003-2008 Free Software Foundation, Inc. + Copyright (C) 2003-2009 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 @@ -29,7 +29,7 @@ #ifndef _GL_UNISTD_H #define _GL_UNISTD_H -/* mingw doesn't define the SEEK_* macros in . */ +/* mingw doesn't define the SEEK_* or *_FILENO macros in . */ #if !(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) # include #endif @@ -87,6 +87,17 @@ /* The definition of GL_LINK_WARNING is copied here. */ +/* OS/2 EMX lacks these macros. */ +#ifndef STDIN_FILENO +# define STDIN_FILENO 0 +#endif +#ifndef STDOUT_FILENO +# define STDOUT_FILENO 1 +#endif +#ifndef STDERR_FILENO +# define STDERR_FILENO 2 +#endif + /* Declare overridden functions. */ #ifdef __cplusplus @@ -475,6 +486,23 @@ extern int lchown (char const *file, uid_t owner, gid_t group); #endif +#if @GNULIB_LINK@ +/* Create a new hard link for an existing file. + Return 0 if successful, otherwise -1 and errno set. + See POSIX:2001 specification + . */ +# if !@HAVE_LINK@ +extern int link (const char *path1, const char *path2); +# endif +#elif defined GNULIB_POSIXCHECK +# undef link +# define link(path1,path2) \ + (GL_LINK_WARNING ("link is unportable - " \ + "use gnulib module link for portability"), \ + link (path1, path2)) +#endif + + #if @GNULIB_LSEEK@ # if @REPLACE_LSEEK@ /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END. diff --git a/gnulib/lib/wchar.in.h b/gnulib/lib/wchar.in.h index 09fc326905..89d6036c31 100644 --- a/gnulib/lib/wchar.in.h +++ b/gnulib/lib/wchar.in.h @@ -1,6 +1,6 @@ /* A substitute for ISO C99 , for platforms that have issues. - Copyright (C) 2007-2008 Free Software Foundation, Inc. + Copyright (C) 2007-2009 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,8 +30,18 @@ @PRAGMA_SYSTEM_HEADER@ #endif -#ifdef __need_mbstate_t -/* Special invocation convention inside uClibc header files. */ +#if defined __need_mbstate_t || (defined __hpux && ((defined _INTTYPES_INCLUDED && !defined strtoimax) || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H)) || defined _GL_ALREADY_INCLUDING_WCHAR_H +/* Special invocation convention: + - Inside uClibc header files. + - On HP-UX 11.00 we have a sequence of nested includes + -> -> , and the latter includes , + once indirectly -> -> -> + and once directly. In both situations 'wint_t' is not yet defined, + therefore we cannot provide the function overrides; instead include only + the system's . + - On IRIX 6.5, similarly, we have an include -> , and + the latter includes . But here, we have no way to detect whether + is completely included or is still being included. */ #@INCLUDE_NEXT@ @NEXT_WCHAR_H@ @@ -40,6 +50,8 @@ #ifndef _GL_WCHAR_H +#define _GL_ALREADY_INCLUDING_WCHAR_H + /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.0.1 has a bug: , and must be @@ -55,6 +67,8 @@ # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ #endif +#undef _GL_ALREADY_INCLUDING_WCHAR_H + #ifndef _GL_WCHAR_H #define _GL_WCHAR_H diff --git a/gnulib/m4/alloca.m4 b/gnulib/m4/alloca.m4 index 95f54a6d48..4b978e137c 100644 --- a/gnulib/m4/alloca.m4 +++ b/gnulib/m4/alloca.m4 @@ -1,5 +1,5 @@ -# alloca.m4 serial 8 -dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc. +# alloca.m4 serial 9 +dnl Copyright (C) 2002-2004, 2006, 2007, 2009 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. @@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_ALLOCA], ]) if test $gl_cv_rpl_alloca = yes; then dnl OK, alloca can be implemented through a compiler built-in. - AC_DEFINE([HAVE_ALLOCA], 1, + AC_DEFINE([HAVE_ALLOCA], [1], [Define to 1 if you have 'alloca' after including , a header that may be supplied by this distribution.]) ALLOCA_H=alloca.h diff --git a/gnulib/m4/codeset.m4 b/gnulib/m4/codeset.m4 index de4181d7d2..413217bd4a 100644 --- a/gnulib/m4/codeset.m4 +++ b/gnulib/m4/codeset.m4 @@ -1,5 +1,5 @@ -# codeset.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2006, 2008 Free Software Foundation, Inc. +# codeset.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2006, 2008, 2009 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. @@ -15,7 +15,7 @@ AC_DEFUN([AM_LANGINFO_CODESET], [am_cv_langinfo_codeset=no]) ]) if test $am_cv_langinfo_codeset = yes; then - AC_DEFINE([HAVE_LANGINFO_CODESET], 1, + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo(CODESET).]) fi ]) diff --git a/gnulib/m4/errno_h.m4 b/gnulib/m4/errno_h.m4 index 22c08f07fa..0682d1ab63 100644 --- a/gnulib/m4/errno_h.m4 +++ b/gnulib/m4/errno_h.m4 @@ -1,5 +1,5 @@ -# errno_h.m4 serial 2 -dnl Copyright (C) 2004, 2006, 2008 Free Software Foundation, Inc. +# errno_h.m4 serial 3 +dnl Copyright (C) 2004, 2006, 2008, 2009 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. @@ -14,8 +14,8 @@ AC_DEFUN([gl_HEADER_ERRNO_H], AC_DEFUN([gl_HEADER_ERRNO_H_BODY], [ AC_REQUIRE([AC_PROG_CC]) - AC_CACHE_CHECK([for complete errno.h], gl_cv_header_errno_h_complete, [ - AC_EGREP_CPP(booboo,[ + AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [ + AC_EGREP_CPP([booboo],[ #include #if !defined ENOMSG booboo @@ -70,7 +70,7 @@ AC_DEFUN([gl_REPLACE_ERRNO_VALUE], [ if test -n "$ERRNO_H"; then AC_CACHE_CHECK([for ]$1[ value], [gl_cv_header_errno_h_]$1, [ - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #include #ifdef ]$1[ yes @@ -79,7 +79,7 @@ yes [gl_cv_header_errno_h_]$1[=yes], [gl_cv_header_errno_h_]$1[=no]) if test $gl_cv_header_errno_h_]$1[ = no; then - AC_EGREP_CPP(yes,[ + AC_EGREP_CPP([yes],[ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifdef ]$1[ diff --git a/gnulib/m4/getaddrinfo.m4 b/gnulib/m4/getaddrinfo.m4 index 9655a4289b..4088671987 100644 --- a/gnulib/m4/getaddrinfo.m4 +++ b/gnulib/m4/getaddrinfo.m4 @@ -1,5 +1,5 @@ -# getaddrinfo.m4 serial 19 -dnl Copyright (C) 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# getaddrinfo.m4 serial 20 +dnl Copyright (C) 2004-2009 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. @@ -18,7 +18,7 @@ AC_DEFUN([gl_GETADDRINFO], dnl - On BeOS, it is in libnet. dnl - On native Windows, it is in ws2_32.dll. dnl - Otherwise it is in libc. - AC_SEARCH_LIBS(getaddrinfo, [socket network net], + AC_SEARCH_LIBS([getaddrinfo], [socket network net], [if test "$ac_cv_search_getaddrinfo" != "none required"; then GETADDRINFO_LIB="$ac_cv_search_getaddrinfo" fi]) @@ -38,7 +38,7 @@ AC_DEFUN([gl_GETADDRINFO], [gl_cv_func_getaddrinfo=yes], [gl_cv_func_getaddrinfo=no])]) if test $gl_cv_func_getaddrinfo = no; then - AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32, + AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], gl_cv_w32_getaddrinfo, [ gl_cv_w32_getaddrinfo=no am_save_LIBS="$LIBS" @@ -55,7 +55,7 @@ AC_DEFUN([gl_GETADDRINFO], GETADDRINFO_LIB="-lws2_32" LIBS="$gai_saved_LIBS $GETADDRINFO_LIB" else - AC_LIBOBJ(getaddrinfo) + AC_LIBOBJ([getaddrinfo]) fi fi @@ -80,7 +80,7 @@ AC_DEFUN([gl_GETADDRINFO], [gl_cv_func_gai_strerror=yes], [gl_cv_func_gai_strerror=no])]) if test $gl_cv_func_gai_strerror = no; then - AC_LIBOBJ(gai_strerror) + AC_LIBOBJ([gai_strerror]) fi LIBS="$gai_saved_LIBS" @@ -106,7 +106,7 @@ AC_DEFUN([gl_PREREQ_GETADDRINFO], [ dnl have sa_len so the result is correct anyway. AC_CHECK_MEMBERS([struct sockaddr.sa_len], , , [#include ]) - AC_CHECK_HEADERS_ONCE(netinet/in.h) + AC_CHECK_HEADERS_ONCE([netinet/in.h]) AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[ /* sys/types.h is not needed according to POSIX, but the diff --git a/gnulib/m4/gethostname.m4 b/gnulib/m4/gethostname.m4 index 217f9c17de..6b6fca95c2 100644 --- a/gnulib/m4/gethostname.m4 +++ b/gnulib/m4/gethostname.m4 @@ -1,5 +1,5 @@ -# gethostname.m4 serial 4 -dnl Copyright (C) 2002, 2008 Free Software Foundation, Inc. +# gethostname.m4 serial 5 +dnl Copyright (C) 2002, 2008, 2009 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,7 +8,7 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME], [ AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) gl_PREREQ_SYS_H_WINSOCK2 - AC_REPLACE_FUNCS(gethostname) + AC_REPLACE_FUNCS([gethostname]) if test $ac_cv_func_gethostname = no; then HAVE_GETHOSTNAME=0 gl_PREREQ_GETHOSTNAME @@ -17,5 +17,5 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME], # Prerequisites of lib/gethostname.c. AC_DEFUN([gl_PREREQ_GETHOSTNAME], [ - AC_CHECK_FUNCS(uname) + AC_CHECK_FUNCS([uname]) ]) diff --git a/gnulib/m4/getline.m4 b/gnulib/m4/getline.m4 index 57625da5c9..99933455f0 100644 --- a/gnulib/m4/getline.m4 +++ b/gnulib/m4/getline.m4 @@ -1,7 +1,6 @@ -# getline.m4 serial 18 +# getline.m4 serial 19 -dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free -dnl Software Foundation, Inc. +dnl Copyright (C) 1998-2003, 2005-2007, 2009 Free Software Foundation, Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -10,7 +9,7 @@ dnl with or without modifications, as long as this notice is preserved. AC_PREREQ([2.59]) dnl See if there's a working, system-supplied version of the getline function. -dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems +dnl We can't just do AC_REPLACE_FUNCS([getline]) because some systems dnl have a function by that name in -linet that doesn't have anything dnl to do with the function we need. AC_DEFUN([gl_FUNC_GETLINE], @@ -23,12 +22,12 @@ AC_DEFUN([gl_FUNC_GETLINE], AC_CHECK_DECLS_ONCE([getline]) gl_getline_needs_run_time_check=no - AC_CHECK_FUNC(getline, + AC_CHECK_FUNC([getline], dnl Found it in some library. Verify that it works. gl_getline_needs_run_time_check=yes, am_cv_func_working_getline=no) if test $gl_getline_needs_run_time_check = yes; then - AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline, + AC_CACHE_CHECK([for working getline function], [am_cv_func_working_getline], [echo fooN |tr -d '\012'|tr N '\012' > conftest.data AC_TRY_RUN([ # include diff --git a/gnulib/m4/getpass.m4 b/gnulib/m4/getpass.m4 index 54348ce7c7..3b55ee48ec 100644 --- a/gnulib/m4/getpass.m4 +++ b/gnulib/m4/getpass.m4 @@ -1,5 +1,5 @@ -# getpass.m4 serial 10 -dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc. +# getpass.m4 serial 11 +dnl Copyright (C) 2002-2003, 2005-2006, 2009 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. @@ -7,8 +7,8 @@ dnl with or without modifications, as long as this notice is preserved. # Provide a getpass() function if the system doesn't have it. AC_DEFUN([gl_FUNC_GETPASS], [ - AC_REPLACE_FUNCS(getpass) - AC_CHECK_DECLS_ONCE(getpass) + AC_REPLACE_FUNCS([getpass]) + AC_CHECK_DECLS_ONCE([getpass]) if test $ac_cv_func_getpass = no; then gl_PREREQ_GETPASS fi @@ -18,9 +18,9 @@ AC_DEFUN([gl_FUNC_GETPASS], # arbitrary length (not just 8 bytes as on HP-UX). AC_DEFUN([gl_FUNC_GETPASS_GNU], [ - AC_CHECK_DECLS_ONCE(getpass) + AC_CHECK_DECLS_ONCE([getpass]) dnl TODO: Detect when GNU getpass() is already found in glibc. - AC_LIBOBJ(getpass) + AC_LIBOBJ([getpass]) gl_PREREQ_GETPASS dnl We must choose a different name for our function, since on ELF systems dnl an unusable getpass() in libc.so would override our getpass() if it is @@ -31,8 +31,8 @@ AC_DEFUN([gl_FUNC_GETPASS_GNU], # Prerequisites of lib/getpass.c. AC_DEFUN([gl_PREREQ_GETPASS], [ - AC_CHECK_HEADERS_ONCE(stdio_ext.h termios.h) - AC_CHECK_FUNCS_ONCE(__fsetlocking tcgetattr tcsetattr) + AC_CHECK_HEADERS_ONCE([stdio_ext.h termios.h]) + AC_CHECK_FUNCS_ONCE([__fsetlocking tcgetattr tcsetattr]) AC_CHECK_DECLS([__fsetlocking],,, [#include #if HAVE_STDIO_EXT_H diff --git a/gnulib/m4/gettext.m4 b/gnulib/m4/gettext.m4 index c48856397b..d90c85008a 100644 --- a/gnulib/m4/gettext.m4 +++ b/gnulib/m4/gettext.m4 @@ -1,5 +1,5 @@ -# gettext.m4 serial 61 (gettext-0.18) -dnl Copyright (C) 1995-2008 Free Software Foundation, Inc. +# gettext.m4 serial 62 (gettext-0.18) +dnl Copyright (C) 1995-2009 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. @@ -123,7 +123,7 @@ AC_DEFUN([AM_GNU_GETTEXT], gt_use_preinstalled_gnugettext=no ifelse(gt_included_intl, yes, [ AC_MSG_CHECKING([whether included gettext is requested]) - AC_ARG_WITH(included-gettext, + AC_ARG_WITH([included-gettext], [ --with-included-gettext use the GNU gettext library included here], nls_cv_force_use_gnu_gettext=$withval, nls_cv_force_use_gnu_gettext=no) @@ -267,7 +267,7 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a if test "$gt_use_preinstalled_gnugettext" = "yes" \ || test "$nls_cv_use_gnu_gettext" = "yes"; then - AC_DEFINE([ENABLE_NLS], 1, + AC_DEFINE([ENABLE_NLS], [1], [Define to 1 if translation of program messages to the user's native language is requested.]) else @@ -301,9 +301,9 @@ return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_a fi dnl For backward compatibility. Some packages may be using this. - AC_DEFINE([HAVE_GETTEXT], 1, + AC_DEFINE([HAVE_GETTEXT], [1], [Define if the GNU gettext() function is already present or preinstalled.]) - AC_DEFINE([HAVE_DCGETTEXT], 1, + AC_DEFINE([HAVE_DCGETTEXT], [1], [Define if the GNU dcgettext() function is already present or preinstalled.]) fi diff --git a/gnulib/m4/gettimeofday.m4 b/gnulib/m4/gettimeofday.m4 index b9bbb1081b..0fec7d42b7 100644 --- a/gnulib/m4/gettimeofday.m4 +++ b/gnulib/m4/gettimeofday.m4 @@ -1,6 +1,6 @@ -#serial 11 +# serial 12 -# Copyright (C) 2001, 2002, 2003, 2005, 2007 Free Software Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009 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. @@ -34,7 +34,7 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h if test $gl_cv_func_gettimeofday_clobber != yes; then - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY fi fi @@ -80,13 +80,13 @@ AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER], REPLACE_GETTIMEOFDAY=1 SYS_TIME_H=sys/time.h gl_GETTIMEOFDAY_REPLACE_LOCALTIME - AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], 1, + AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1], [Define if gettimeofday clobbers the localtime buffer.]) fi ]) AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [ - AC_LIBOBJ(gettimeofday) + AC_LIBOBJ([gettimeofday]) gl_PREREQ_GETTIMEOFDAY AC_DEFINE([gmtime], [rpl_gmtime], [Define to rpl_gmtime if the replacement function should be used.]) diff --git a/gnulib/m4/gnulib-cache.m4 b/gnulib/m4/gnulib-cache.m4 index 77a285f766..74b2139610 100644 --- 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 --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify +# gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib/lib --m4-base=gnulib/m4 --doc-base=doc --tests-base=gnulib/tests --aux-dir=build-aux --with-tests --lgpl=2 --libtool --macro-prefix=gl --no-vc-files c-ctype close connect getaddrinfo gethostname getpass gettext inet_pton ioctl mkstemp mktempd perror physmem poll posix-shell random_r recv send setsockopt socket strerror strndup strsep sys_stat time_r useless-if-before-free vasprintf vc-list-files verify # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([]) @@ -35,6 +35,7 @@ gl_MODULES([ physmem poll posix-shell + random_r recv send setsockopt diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4 index c73db14cc5..cfd1b99f82 100644 --- a/gnulib/m4/gnulib-common.m4 +++ b/gnulib/m4/gnulib-common.m4 @@ -1,5 +1,5 @@ -# gnulib-common.m4 serial 6 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# gnulib-common.m4 serial 8 +dnl Copyright (C) 2007-2009 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. @@ -63,7 +63,7 @@ m4_ifdef([AC_PROG_MKDIR_P], [], [ # works. # This definition can be removed once autoconf >= 2.62 can be assumed. AC_DEFUN([AC_C_RESTRICT], -[AC_CACHE_CHECK([for C/C++ restrict keyword], ac_cv_c_restrict, +[AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict], [ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do @@ -99,3 +99,12 @@ AC_DEFUN([AC_C_RESTRICT], *) AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;; esac ]) + +# gl_BIGENDIAN +# is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd. +# Note that AC_REQUIRE([AC_C_BIGENDIAN]) does not work reliably because some +# macros invoke AC_C_BIGENDIAN with arguments. +AC_DEFUN([gl_BIGENDIAN], +[ + AC_C_BIGENDIAN +]) diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index 1393b97b70..e8747d85a8 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -106,6 +106,8 @@ AC_SUBST([LTALLOCA]) gl_PHYSMEM gl_FUNC_POLL gl_POSIX_SHELL + gl_FUNC_RANDOM_R + gl_STDLIB_MODULE_INDICATOR([random_r]) gl_FUNC_REALLOC_POSIX gl_STDLIB_MODULE_INDICATOR([realloc-posix]) AC_REQUIRE([gl_HEADER_SYS_SOCKET]) @@ -370,6 +372,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/printf-args.h lib/printf-parse.c lib/printf-parse.h + lib/random_r.c lib/realloc.c lib/recv.c lib/send.c @@ -461,6 +464,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/printf-posix.m4 m4/printf.m4 m4/progtest.m4 + m4/random_r.m4 m4/realloc.m4 m4/servent.m4 m4/size_max.m4 @@ -516,6 +520,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-perror.c tests/test-perror.sh tests/test-poll.c + tests/test-random_r.c tests/test-snprintf.c tests/test-sockets.c tests/test-stdbool.c diff --git a/gnulib/m4/iconv.m4 b/gnulib/m4/iconv.m4 index 848b2f85c3..3cc626829e 100644 --- a/gnulib/m4/iconv.m4 +++ b/gnulib/m4/iconv.m4 @@ -1,5 +1,5 @@ -# iconv.m4 serial AM6 (gettext-0.18) -dnl Copyright (C) 2000-2002, 2007-2008 Free Software Foundation, Inc. +# iconv.m4 serial AM7 (gettext-0.18) +dnl Copyright (C) 2000-2002, 2007-2009 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. @@ -134,7 +134,7 @@ int main () am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then - AC_DEFINE([HAVE_ICONV], 1, + AC_DEFINE([HAVE_ICONV], [1], [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then diff --git a/gnulib/m4/inet_ntop.m4 b/gnulib/m4/inet_ntop.m4 index 6f873063b9..42bfc5e417 100644 --- a/gnulib/m4/inet_ntop.m4 +++ b/gnulib/m4/inet_ntop.m4 @@ -1,5 +1,5 @@ -# inet_ntop.m4 serial 7 -dnl Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc. +# inet_ntop.m4 serial 8 +dnl Copyright (C) 2005, 2006, 2008, 2009 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. @@ -11,7 +11,7 @@ AC_DEFUN([gl_INET_NTOP], gl_REPLACE_ARPA_INET_H - AC_REPLACE_FUNCS(inet_ntop) + AC_REPLACE_FUNCS([inet_ntop]) gl_PREREQ_INET_NTOP ]) diff --git a/gnulib/m4/inet_pton.m4 b/gnulib/m4/inet_pton.m4 index 06331e9dec..e0ec432bc6 100644 --- a/gnulib/m4/inet_pton.m4 +++ b/gnulib/m4/inet_pton.m4 @@ -1,5 +1,5 @@ -# inet_pton.m4 serial 6 -dnl Copyright (C) 2006, 2008 Free Software Foundation, Inc. +# inet_pton.m4 serial 7 +dnl Copyright (C) 2006, 2008, 2009 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. @@ -11,7 +11,7 @@ AC_DEFUN([gl_INET_PTON], gl_REPLACE_ARPA_INET_H - AC_REPLACE_FUNCS(inet_pton) + AC_REPLACE_FUNCS([inet_pton]) gl_PREREQ_INET_PTON ]) diff --git a/gnulib/m4/intldir.m4 b/gnulib/m4/intldir.m4 index 7a28843f64..0980e6f286 100644 --- a/gnulib/m4/intldir.m4 +++ b/gnulib/m4/intldir.m4 @@ -1,5 +1,5 @@ -# intldir.m4 serial 1 (gettext-0.16) -dnl Copyright (C) 2006 Free Software Foundation, Inc. +# intldir.m4 serial 2 (gettext-0.18) +dnl Copyright (C) 2006, 2009 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. @@ -13,7 +13,7 @@ dnl by the GNU Library General Public License, and the rest of the GNU dnl gettext package package is covered by the GNU General Public License. dnl They are *not* in the public domain. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) dnl Tells the AM_GNU_GETTEXT macro to consider an intl/ directory. AC_DEFUN([AM_GNU_GETTEXT_INTL_SUBDIR], []) diff --git a/gnulib/m4/intlmacosx.m4 b/gnulib/m4/intlmacosx.m4 index b77527d17d..c24837c429 100644 --- a/gnulib/m4/intlmacosx.m4 +++ b/gnulib/m4/intlmacosx.m4 @@ -1,5 +1,5 @@ -# intlmacosx.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2004-2008 Free Software Foundation, Inc. +# intlmacosx.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2004-2009 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,7 +28,7 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFPreferencesCopyAppValue=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then - AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, + AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1], [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) fi dnl Check for API introduced in MacOS X 10.3. @@ -40,7 +40,7 @@ AC_DEFUN([gt_INTL_MACOSX], [gt_cv_func_CFLocaleCopyCurrent=no]) LIBS="$gt_save_LIBS"]) if test $gt_cv_func_CFLocaleCopyCurrent = yes; then - AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, + AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1], [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) fi INTL_MACOSX_LIBS= diff --git a/gnulib/m4/intmax.m4 b/gnulib/m4/intmax.m4 index d713db2286..a3785e9989 100644 --- a/gnulib/m4/intmax.m4 +++ b/gnulib/m4/intmax.m4 @@ -1,5 +1,5 @@ -# intmax.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2002-2005, 2008 Free Software Foundation, Inc. +# intmax.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 2002-2005, 2008, 2009 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. @@ -27,7 +27,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T], [gt_cv_c_intmax_t=yes], [gt_cv_c_intmax_t=no])]) if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE([HAVE_INTMAX_T], 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) fi ]) diff --git a/gnulib/m4/intmax_t.m4 b/gnulib/m4/intmax_t.m4 index 50ae35d223..264cb57184 100644 --- a/gnulib/m4/intmax_t.m4 +++ b/gnulib/m4/intmax_t.m4 @@ -1,12 +1,12 @@ -# intmax_t.m4 serial 6 -dnl Copyright (C) 1997-2004, 2006-2007 Free Software Foundation, Inc. +# intmax_t.m4 serial 7 +dnl Copyright (C) 1997-2004, 2006-2007, 2009 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 Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) # Define intmax_t to 'long' or 'long long' # if it is not already defined in or . @@ -22,10 +22,10 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T], test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) else - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) fi ]) @@ -36,7 +36,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], [ AC_REQUIRE([gl_AC_HEADER_INTTYPES_H]) AC_REQUIRE([gl_AC_HEADER_STDINT_H]) - AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t, + AC_CACHE_CHECK([for intmax_t], [gt_cv_c_intmax_t], [AC_TRY_COMPILE([ #include #include @@ -48,14 +48,14 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T], #endif ], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)]) if test $gt_cv_c_intmax_t = yes; then - AC_DEFINE(HAVE_INTMAX_T, 1, + AC_DEFINE([HAVE_INTMAX_T], [1], [Define if you have the 'intmax_t' type in or .]) else AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) test $ac_cv_type_long_long_int = yes \ && ac_type='long long' \ || ac_type='long' - AC_DEFINE_UNQUOTED(intmax_t, $ac_type, + AC_DEFINE_UNQUOTED([intmax_t], [$ac_type], [Define to long or long long if and don't define.]) fi ]) diff --git a/gnulib/m4/inttypes-pri.m4 b/gnulib/m4/inttypes-pri.m4 index 66650ebdc8..98fec7bcf6 100644 --- a/gnulib/m4/inttypes-pri.m4 +++ b/gnulib/m4/inttypes-pri.m4 @@ -1,12 +1,12 @@ -# inttypes-pri.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1997-2002, 2006, 2008 Free Software Foundation, Inc. +# inttypes-pri.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1997-2002, 2006, 2008, 2009 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. -AC_PREREQ(2.52) +AC_PREREQ([2.52]) # Define PRI_MACROS_BROKEN if exists and defines the PRI* # macros to non-string values. This is the case on AIX 4.3.3. @@ -26,7 +26,7 @@ char *p = PRId32; ]) fi if test "$gt_cv_inttypes_pri_broken" = yes; then - AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], 1, + AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1], [Define if exists and defines unusable PRI* macros.]) PRI_MACROS_BROKEN=1 else diff --git a/gnulib/m4/inttypes_h.m4 b/gnulib/m4/inttypes_h.m4 index cf482d2875..f4ca16021c 100644 --- a/gnulib/m4/inttypes_h.m4 +++ b/gnulib/m4/inttypes_h.m4 @@ -1,5 +1,5 @@ -# inttypes_h.m4 serial 8 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# inttypes_h.m4 serial 9 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_INTTYPES_H], [gl_cv_header_inttypes_h=yes], [gl_cv_header_inttypes_h=no])]) if test $gl_cv_header_inttypes_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_INTTYPES_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi diff --git a/gnulib/m4/lcmessage.m4 b/gnulib/m4/lcmessage.m4 index b7c4730272..fa8e4167ac 100644 --- a/gnulib/m4/lcmessage.m4 +++ b/gnulib/m4/lcmessage.m4 @@ -1,5 +1,5 @@ -# lcmessage.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1995-2002, 2004-2005, 2008 Free Software Foundation, Inc. +# lcmessage.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1995-2002, 2004-2005, 2008, 2009 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. @@ -24,7 +24,7 @@ AC_DEFUN([gt_LC_MESSAGES], [AC_TRY_LINK([#include ], [return LC_MESSAGES], [gt_cv_val_LC_MESSAGES=yes], [gt_cv_val_LC_MESSAGES=no])]) if test $gt_cv_val_LC_MESSAGES = yes; then - AC_DEFINE([HAVE_LC_MESSAGES], 1, + AC_DEFINE([HAVE_LC_MESSAGES], [1], [Define if your file defines LC_MESSAGES.]) fi ]) diff --git a/gnulib/m4/lib-ld.m4 b/gnulib/m4/lib-ld.m4 index 96c4e2c339..e4863f2c9b 100644 --- a/gnulib/m4/lib-ld.m4 +++ b/gnulib/m4/lib-ld.m4 @@ -1,5 +1,5 @@ -# lib-ld.m4 serial 3 (gettext-0.13) -dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +# lib-ld.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2009 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. @@ -10,7 +10,7 @@ dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], -[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conftest.sh . ./conftest.sh @@ -131,7 +131,7 @@ AC_DEFUN([AC_LIB_RPATH], acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. - AC_ARG_ENABLE(rpath, + AC_ARG_ENABLE([rpath], [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) diff --git a/gnulib/m4/lock.m4 b/gnulib/m4/lock.m4 index 9fec570dcd..b416e31a35 100644 --- a/gnulib/m4/lock.m4 +++ b/gnulib/m4/lock.m4 @@ -1,5 +1,5 @@ -# lock.m4 serial 9 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# lock.m4 serial 10 (gettext-0.18) +dnl Copyright (C) 2005-2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_LOCK], # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the # pthread_rwlock_* functions. AC_CHECK_TYPE([pthread_rwlock_t], - [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1, + [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1], [Define if the POSIX multithreading library has read/write locks.])], [], [#include ]) @@ -25,7 +25,7 @@ error "No, in FreeBSD 4.0 recursive mutexes actually don't work." int x = (int)PTHREAD_MUTEX_RECURSIVE; return !x; #endif], - [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1, + [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], [1], [Define if the defines PTHREAD_MUTEX_RECURSIVE.])]) fi gl_PREREQ_LOCK diff --git a/gnulib/m4/longlong.m4 b/gnulib/m4/longlong.m4 index 15bf9dacad..eedc8d5682 100644 --- a/gnulib/m4/longlong.m4 +++ b/gnulib/m4/longlong.m4 @@ -1,5 +1,5 @@ -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009 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. @@ -46,7 +46,7 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -69,7 +69,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) diff --git a/gnulib/m4/lstat.m4 b/gnulib/m4/lstat.m4 index fc222e286e..74c78fe48a 100644 --- a/gnulib/m4/lstat.m4 +++ b/gnulib/m4/lstat.m4 @@ -1,7 +1,6 @@ -#serial 18 +# serial 19 -# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008 -# Free Software Foundation, Inc. +# Copyright (C) 1997-2001, 2003-2009 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,7 +16,7 @@ AC_DEFUN([gl_FUNC_LSTAT], AC_CHECK_FUNCS_ONCE([lstat]) if test $ac_cv_func_lstat = yes; then AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK - dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ(lstat). + dnl Note: AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK does AC_LIBOBJ([lstat]). if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then REPLACE_LSTAT=1 fi diff --git a/gnulib/m4/malloc.m4 b/gnulib/m4/malloc.m4 index 764f2a9fa1..807017166b 100644 --- a/gnulib/m4/malloc.m4 +++ b/gnulib/m4/malloc.m4 @@ -1,5 +1,5 @@ -# malloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# malloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_MALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_MALLOC_POSIX=1 - AC_DEFINE([HAVE_MALLOC_POSIX], 1, + AC_DEFINE([HAVE_MALLOC_POSIX], [1], [Define if the 'malloc' function is POSIX compliant.]) else AC_LIBOBJ([malloc]) diff --git a/gnulib/m4/nls.m4 b/gnulib/m4/nls.m4 index 5f155f01a2..0b36434215 100644 --- a/gnulib/m4/nls.m4 +++ b/gnulib/m4/nls.m4 @@ -1,5 +1,5 @@ -# nls.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 1995-2003, 2005-2006, 2008 Free Software Foundation, Inc. +# nls.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 1995-2003, 2005-2006, 2008, 2009 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. @@ -17,15 +17,15 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) AC_DEFUN([AM_NLS], [ AC_MSG_CHECKING([whether NLS is requested]) dnl Default is enabled NLS - AC_ARG_ENABLE(nls, + AC_ARG_ENABLE([nls], [ --disable-nls do not use Native Language Support], USE_NLS=$enableval, USE_NLS=yes) - AC_MSG_RESULT($USE_NLS) + AC_MSG_RESULT([$USE_NLS]) AC_SUBST([USE_NLS]) ]) diff --git a/gnulib/m4/physmem.m4 b/gnulib/m4/physmem.m4 index b5001e1fc9..2d79a69972 100644 --- a/gnulib/m4/physmem.m4 +++ b/gnulib/m4/physmem.m4 @@ -1,5 +1,5 @@ -# physmem.m4 serial 8 -dnl Copyright (C) 2002-2003, 2005-2006, 2008 Free Software Foundation, Inc. +# physmem.m4 serial 9 +dnl Copyright (C) 2002-2003, 2005-2006, 2008-2009 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. @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. # Check for the external symbol, _system_configuration, # a struct with member `physmem'. AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION], - [AC_CACHE_CHECK(for external symbol _system_configuration, + [AC_CACHE_CHECK([for external symbol _system_configuration], gl_cv_var__system_configuration, [AC_LINK_IFELSE([AC_LANG_PROGRAM( [[#include @@ -18,7 +18,7 @@ AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION], [gl_cv_var__system_configuration=no])]) if test $gl_cv_var__system_configuration = yes; then - AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1, + AC_DEFINE([HAVE__SYSTEM_CONFIGURATION], [1], [Define to 1 if you have the external variable, _system_configuration with a member named physmem.]) fi @@ -34,6 +34,6 @@ AC_DEFUN([gl_PHYSMEM], machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \ sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT]) - AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table) + AC_CHECK_FUNCS([pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table]) AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION]) ]) diff --git a/gnulib/m4/po.m4 b/gnulib/m4/po.m4 index 818143e713..2284fa5054 100644 --- a/gnulib/m4/po.m4 +++ b/gnulib/m4/po.m4 @@ -1,5 +1,5 @@ -# po.m4 serial 16 (gettext-0.18) -dnl Copyright (C) 1995-2008 Free Software Foundation, Inc. +# po.m4 serial 17 (gettext-0.18) +dnl Copyright (C) 1995-2009 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. @@ -17,7 +17,7 @@ dnl Authors: dnl Ulrich Drepper , 1995-2000. dnl Bruno Haible , 2000-2003. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) dnl Checks for all prerequisites of the po subdirectory. AC_DEFUN([AM_PO_SUBDIRS], diff --git a/gnulib/m4/poll.m4 b/gnulib/m4/poll.m4 index bb610dadd0..a16e3769fb 100644 --- a/gnulib/m4/poll.m4 +++ b/gnulib/m4/poll.m4 @@ -1,16 +1,16 @@ -# poll.m4 serial 7 -dnl Copyright (c) 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# poll.m4 serial 8 +dnl Copyright (c) 2003, 2005, 2006, 2007, 2009 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. AC_DEFUN([gl_FUNC_POLL], [ - AC_CHECK_HEADERS(poll.h) + AC_CHECK_HEADERS([poll.h]) if test "$ac_cv_header_poll_h" = no; then gl_cv_func_poll=no else - AC_CHECK_FUNC(poll, + AC_CHECK_FUNC([poll], [# Check whether poll() works on special files (like /dev/null) and # and ttys (like /dev/tty). On MacOS X 10.4.0 and AIX 5.3, it doesn't. AC_TRY_RUN([ @@ -51,12 +51,12 @@ This is MacOSX or AIX ], [gl_cv_func_poll=no], [gl_cv_func_poll=yes])])]) fi if test $gl_cv_func_poll = yes; then - AC_DEFINE([HAVE_POLL], 1, + AC_DEFINE([HAVE_POLL], [1], [Define to 1 if you have the 'poll' function and it works.]) POLL_H= else - AC_LIBOBJ(poll) - AC_DEFINE(poll, rpl_poll, + AC_LIBOBJ([poll]) + AC_DEFINE([poll], [rpl_poll], [Define to poll if the replacement function should be used.]) gl_PREREQ_POLL POLL_H=poll.h @@ -67,5 +67,5 @@ This is MacOSX or AIX # Prerequisites of lib/poll.c. AC_DEFUN([gl_PREREQ_POLL], [ - AC_CHECK_HEADERS_ONCE(sys/ioctl.h sys/filio.h) + AC_CHECK_HEADERS_ONCE([sys/ioctl.h sys/filio.h]) ]) diff --git a/gnulib/m4/printf-posix.m4 b/gnulib/m4/printf-posix.m4 index 8933ee399d..5922d27891 100644 --- a/gnulib/m4/printf-posix.m4 +++ b/gnulib/m4/printf-posix.m4 @@ -1,5 +1,5 @@ -# printf-posix.m4 serial 4 (gettext-0.18) -dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc. +# printf-posix.m4 serial 5 (gettext-0.18) +dnl Copyright (C) 2003, 2007, 2009 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. @@ -27,7 +27,7 @@ int main () return (strcmp (buf, "55 33") != 0); }], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no, [ - AC_EGREP_CPP(notposix, [ + AC_EGREP_CPP([notposix], [ #if defined __NetBSD__ || defined __BEOS__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__ notposix #endif @@ -38,7 +38,7 @@ int main () ]) case $gt_cv_func_printf_posix in *yes) - AC_DEFINE([HAVE_POSIX_PRINTF], 1, + AC_DEFINE([HAVE_POSIX_PRINTF], [1], [Define if your printf() function supports format strings with positions.]) ;; esac diff --git a/gnulib/m4/printf.m4 b/gnulib/m4/printf.m4 index 474a635575..a1d4dadd7b 100644 --- a/gnulib/m4/printf.m4 +++ b/gnulib/m4/printf.m4 @@ -1,5 +1,5 @@ -# printf.m4 serial 25 -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# printf.m4 serial 28 +dnl Copyright (C) 2003, 2007-2009 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. @@ -225,12 +225,12 @@ AC_DEFUN([gl_PRINTF_INFINITE_LONG_DOUBLE], [ AC_REQUIRE([gl_PRINTF_LONG_DOUBLE]) AC_REQUIRE([AC_PROG_CC]) - AC_REQUIRE([AC_C_BIGENDIAN]) + AC_REQUIRE([gl_BIGENDIAN]) AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl The user can set or unset the variable gl_printf_safe to indicate dnl that he wishes a safe handling of non-IEEE-754 'long double' values. if test -n "$gl_printf_safe"; then - AC_DEFINE([CHECK_PRINTF_SAFE], 1, + AC_DEFINE([CHECK_PRINTF_SAFE], [1], [Define if you wish *printf() functions that have a safe handling of non-IEEE-754 'long double' values.]) fi @@ -1142,7 +1142,7 @@ AC_DEFUN([gl_SNPRINTF_SIZE1], #include int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; snprintf (buf, 1, "%d", 12345); return buf[1] != 'E'; }], @@ -1160,7 +1160,7 @@ dnl --------------------------------------------------------------------- dnl #include dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1181,7 +1181,7 @@ dnl return ret; dnl } dnl int main() dnl { -dnl static char buf[8] = "DEADBEEF"; +dnl static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; dnl my_snprintf (buf, 0, "%d", 12345); dnl return buf[0] != 'D'; dnl } @@ -1209,7 +1209,7 @@ static int my_snprintf (char *buf, int size, const char *format, ...) } int main() { - static char buf[8] = "DEADBEEF"; + static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' }; my_snprintf (buf, 0, "%d", 12345); return buf[0] != 'D'; }], diff --git a/gnulib/m4/progtest.m4 b/gnulib/m4/progtest.m4 index 9b55f75120..e1d445d267 100644 --- a/gnulib/m4/progtest.m4 +++ b/gnulib/m4/progtest.m4 @@ -1,5 +1,5 @@ -# progtest.m4 serial 5 (gettext-0.18) -dnl Copyright (C) 1996-2003, 2005, 2008 Free Software Foundation, Inc. +# progtest.m4 serial 6 (gettext-0.18) +dnl Copyright (C) 1996-2003, 2005, 2008, 2009 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. @@ -16,7 +16,7 @@ dnl They are *not* in the public domain. dnl Authors: dnl Ulrich Drepper , 1996. -AC_PREREQ(2.50) +AC_PREREQ([2.50]) # Search path for a program which passes the given test. @@ -88,5 +88,5 @@ if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then else AC_MSG_RESULT([no]) fi -AC_SUBST($1)dnl +AC_SUBST([$1])dnl ]) diff --git a/gnulib/m4/random_r.m4 b/gnulib/m4/random_r.m4 new file mode 100644 index 0000000000..03e18f80d0 --- /dev/null +++ b/gnulib/m4/random_r.m4 @@ -0,0 +1,21 @@ +# serial 1 +dnl Copyright (C) 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. + +AC_DEFUN([gl_FUNC_RANDOM_R], +[ + AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) + AC_CHECK_FUNCS([random_r]) + if test $ac_cv_func_random_r = no; then + HAVE_RANDOM_R=0 + AC_LIBOBJ([random_r]) + gl_PREREQ_RANDOM_R + fi +]) + +# Prerequisites of lib/random_r.c. +AC_DEFUN([gl_PREREQ_RANDOM_R], [ + : +]) diff --git a/gnulib/m4/realloc.m4 b/gnulib/m4/realloc.m4 index f9fd935dbb..5925796864 100644 --- a/gnulib/m4/realloc.m4 +++ b/gnulib/m4/realloc.m4 @@ -1,5 +1,5 @@ -# realloc.m4 serial 8 -dnl Copyright (C) 2007 Free Software Foundation, Inc. +# realloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_REALLOC_POSIX], AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) if test $gl_cv_func_malloc_posix = yes; then HAVE_REALLOC_POSIX=1 - AC_DEFINE([HAVE_REALLOC_POSIX], 1, + AC_DEFINE([HAVE_REALLOC_POSIX], [1], [Define if the 'realloc' function is POSIX compliant.]) else AC_LIBOBJ([realloc]) diff --git a/gnulib/m4/sockets.m4 b/gnulib/m4/sockets.m4 index 124e777a5e..d5a7dbfb4b 100644 --- a/gnulib/m4/sockets.m4 +++ b/gnulib/m4/sockets.m4 @@ -1,5 +1,5 @@ -# sockets.m4 serial 3 -dnl Copyright (C) 2008 Free Software Foundation, Inc. +# sockets.m4 serial 4 +dnl Copyright (C) 2008, 2009 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. @@ -26,7 +26,7 @@ AC_DEFUN([gl_SOCKETS], LIBS="$gl_save_LIBS" ]) if test "$gl_cv_func_wsastartup" = "yes"; then - AC_DEFINE([WINDOWS_SOCKETS], 1, [Define if WSAStartup is needed.]) + AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) LIBSOCKET='-lws2_32' fi else diff --git a/gnulib/m4/sockpfaf.m4 b/gnulib/m4/sockpfaf.m4 index 25d9755c5e..99ea06f96f 100644 --- a/gnulib/m4/sockpfaf.m4 +++ b/gnulib/m4/sockpfaf.m4 @@ -1,5 +1,5 @@ -# sockpfaf.m4 serial 5 -dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc. +# sockpfaf.m4 serial 6 +dnl Copyright (C) 2004, 2006, 2009 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. @@ -16,8 +16,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], AC_REQUIRE([gl_HEADER_SYS_SOCKET]) AC_CHECK_HEADERS_ONCE([netinet/in.h]) - AC_MSG_CHECKING(for IPv4 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv4, + AC_MSG_CHECKING([for IPv4 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv4], [AC_TRY_COMPILE([#include #ifdef HAVE_SYS_SOCKET_H #include @@ -31,13 +31,13 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET; struct in_addr y; struct sockaddr_in z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv4) + AC_MSG_RESULT([$gl_cv_socket_ipv4]) if test $gl_cv_socket_ipv4 = yes; then - AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if defines AF_INET.]) + AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if defines AF_INET.]) fi - AC_MSG_CHECKING(for IPv6 sockets) - AC_CACHE_VAL(gl_cv_socket_ipv6, + AC_MSG_CHECKING([for IPv6 sockets]) + AC_CACHE_VAL([gl_cv_socket_ipv6], [AC_TRY_COMPILE([#include #ifdef HAVE_SYS_SOCKET_H #include @@ -51,8 +51,8 @@ AC_DEFUN([gl_SOCKET_FAMILIES], [int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z; if (&x && &y && &z) return 0;], gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)]) - AC_MSG_RESULT($gl_cv_socket_ipv6) + AC_MSG_RESULT([$gl_cv_socket_ipv6]) if test $gl_cv_socket_ipv6 = yes; then - AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if defines AF_INET6.]) + AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if defines AF_INET6.]) fi ]) diff --git a/gnulib/m4/stdbool.m4 b/gnulib/m4/stdbool.m4 index 2204ecd984..57c804a80f 100644 --- a/gnulib/m4/stdbool.m4 +++ b/gnulib/m4/stdbool.m4 @@ -1,6 +1,6 @@ # Check for stdbool.h that conforms to C99. -dnl Copyright (C) 2002-2006 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2006, 2009 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. @@ -111,5 +111,5 @@ AC_DEFUN([AC_HEADER_STDBOOL], [ac_cv_header_stdbool_h=no])]) AC_CHECK_TYPES([_Bool]) if test $ac_cv_header_stdbool_h = yes; then - AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.]) + AC_DEFINE([HAVE_STDBOOL_H], [1], [Define to 1 if stdbool.h conforms to C99.]) fi]) diff --git a/gnulib/m4/stdint.m4 b/gnulib/m4/stdint.m4 index e507a02eb8..b4194c8adc 100644 --- a/gnulib/m4/stdint.m4 +++ b/gnulib/m4/stdint.m4 @@ -1,5 +1,5 @@ -# stdint.m4 serial 32 -dnl Copyright (C) 2001-2008 Free Software Foundation, Inc. +# stdint.m4 serial 33 +dnl Copyright (C) 2001-2009 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,7 +9,7 @@ dnl Test whether is supported or must be substituted. AC_DEFUN([gl_STDINT_H], [ - AC_PREREQ(2.59)dnl + AC_PREREQ([2.59])dnl dnl Check for long long int and unsigned long long int. AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) @@ -229,7 +229,7 @@ struct s { gl_STDINT_TYPE_PROPERTIES STDINT_H=stdint.h fi - AC_SUBST(STDINT_H) + AC_SUBST([STDINT_H]) ]) dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES) @@ -292,7 +292,7 @@ AC_DEFUN([gl_CHECK_TYPES_SIGNED], eval result=\$gl_cv_type_${gltype}_signed GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'` if test "$result" = yes; then - AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1) + AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1]) eval HAVE_SIGNED_${GLTYPE}=1 else eval HAVE_SIGNED_${GLTYPE}=0 @@ -348,7 +348,7 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX], eval result=\$gl_cv_type_${gltype}_suffix test "$result" = no && result= eval ${GLTYPE}_SUFFIX=\$result - AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result) + AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result]) done m4_foreach_w([gltype], [$1], [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])]) diff --git a/gnulib/m4/stdint_h.m4 b/gnulib/m4/stdint_h.m4 index 2c8e649799..82f0c244c8 100644 --- a/gnulib/m4/stdint_h.m4 +++ b/gnulib/m4/stdint_h.m4 @@ -1,5 +1,5 @@ -# stdint_h.m4 serial 7 -dnl Copyright (C) 1997-2004, 2006, 2008 Free Software Foundation, Inc. +# stdint_h.m4 serial 8 +dnl Copyright (C) 1997-2004, 2006, 2008, 2009 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. @@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_HEADER_STDINT_H], [gl_cv_header_stdint_h=yes], [gl_cv_header_stdint_h=no])]) if test $gl_cv_header_stdint_h = yes; then - AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], 1, + AC_DEFINE_UNQUOTED([HAVE_STDINT_H_WITH_UINTMAX], [1], [Define if exists, doesn't clash with , and declares uintmax_t. ]) fi diff --git a/gnulib/m4/stdio_h.m4 b/gnulib/m4/stdio_h.m4 index 60b4bd791a..846b65d302 100644 --- a/gnulib/m4/stdio_h.m4 +++ b/gnulib/m4/stdio_h.m4 @@ -1,5 +1,5 @@ -# stdio_h.m4 serial 14 -dnl Copyright (C) 2007-2008 Free Software Foundation, Inc. +# stdio_h.m4 serial 15 +dnl Copyright (C) 2007-2009 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. @@ -53,6 +53,8 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], GNULIB_VPRINTF_POSIX=0; AC_SUBST([GNULIB_VPRINTF_POSIX]) GNULIB_VSNPRINTF=0; AC_SUBST([GNULIB_VSNPRINTF]) GNULIB_VSPRINTF_POSIX=0; AC_SUBST([GNULIB_VSPRINTF_POSIX]) + GNULIB_DPRINTF=0; AC_SUBST([GNULIB_DPRINTF]) + GNULIB_VDPRINTF=0; AC_SUBST([GNULIB_VDPRINTF]) GNULIB_VASPRINTF=0; AC_SUBST([GNULIB_VASPRINTF]) GNULIB_OBSTACK_PRINTF=0; AC_SUBST([GNULIB_OBSTACK_PRINTF]) GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX]) @@ -86,6 +88,10 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS], HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) REPLACE_SPRINTF=0; AC_SUBST([REPLACE_SPRINTF]) REPLACE_VSPRINTF=0; AC_SUBST([REPLACE_VSPRINTF]) + HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) + REPLACE_DPRINTF=0; AC_SUBST([REPLACE_DPRINTF]) + HAVE_VDPRINTF=1; AC_SUBST([HAVE_VDPRINTF]) + REPLACE_VDPRINTF=0; AC_SUBST([REPLACE_VDPRINTF]) HAVE_VASPRINTF=1; AC_SUBST([HAVE_VASPRINTF]) REPLACE_VASPRINTF=0; AC_SUBST([REPLACE_VASPRINTF]) HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) diff --git a/gnulib/m4/strdup.m4 b/gnulib/m4/strdup.m4 index 0537def373..d7daac2bab 100644 --- a/gnulib/m4/strdup.m4 +++ b/gnulib/m4/strdup.m4 @@ -1,6 +1,6 @@ -# strdup.m4 serial 10 +# strdup.m4 serial 11 -dnl Copyright (C) 2002-2008 Free Software Foundation, Inc. +dnl Copyright (C) 2002-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,8 +9,8 @@ dnl with or without modifications, as long as this notice is preserved. AC_DEFUN([gl_FUNC_STRDUP], [ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS(strdup) - AC_CHECK_DECLS_ONCE(strdup) + AC_REPLACE_FUNCS([strdup]) + AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 fi @@ -25,9 +25,9 @@ AC_DEFUN([gl_FUNC_STRDUP_POSIX], REPLACE_STRDUP=1 AC_LIBOBJ([strdup]) else - AC_REPLACE_FUNCS(strdup) + AC_REPLACE_FUNCS([strdup]) fi - AC_CHECK_DECLS_ONCE(strdup) + AC_CHECK_DECLS_ONCE([strdup]) if test $ac_cv_have_decl_strdup = no; then HAVE_DECL_STRDUP=0 fi diff --git a/gnulib/m4/strndup.m4 b/gnulib/m4/strndup.m4 index 1be2a85c5e..4fa7d5a7c9 100644 --- a/gnulib/m4/strndup.m4 +++ b/gnulib/m4/strndup.m4 @@ -1,5 +1,5 @@ -# strndup.m4 serial 15 -dnl Copyright (C) 2002-2003, 2005-2008 Free Software Foundation, Inc. +# strndup.m4 serial 16 +dnl Copyright (C) 2002-2003, 2005-2009 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. @@ -16,7 +16,7 @@ AC_DEFUN([gl_FUNC_STRNDUP], fi # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'. - AC_CACHE_CHECK([for working strndup], gl_cv_func_strndup, + AC_CACHE_CHECK([for working strndup], [gl_cv_func_strndup], [AC_RUN_IFELSE([ AC_LANG_PROGRAM([[#include #include ]], [[ @@ -40,7 +40,7 @@ AC_DEFUN([gl_FUNC_STRNDUP], [gl_cv_func_strndup=yes])], [gl_cv_func_strndup=no])])]) if test $gl_cv_func_strndup = yes; then - AC_DEFINE([HAVE_STRNDUP], 1, + AC_DEFINE([HAVE_STRNDUP], [1], [Define if you have the strndup() function and it works.]) else HAVE_STRNDUP=0 diff --git a/gnulib/m4/strnlen.m4 b/gnulib/m4/strnlen.m4 index d8307eda4a..1c97859db1 100644 --- a/gnulib/m4/strnlen.m4 +++ b/gnulib/m4/strnlen.m4 @@ -1,5 +1,5 @@ -# strnlen.m4 serial 9 -dnl Copyright (C) 2002-2003, 2005-2007 Free Software Foundation, Inc. +# strnlen.m4 serial 10 +dnl Copyright (C) 2002-2003, 2005-2007, 2009 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. @@ -20,8 +20,8 @@ AC_DEFUN([gl_FUNC_STRNLEN], # This is necessary because automake-1.6.1 doesn't understand # that the above use of AC_FUNC_STRNLEN means we may have to use # lib/strnlen.c. - #AC_LIBOBJ(strnlen) - AC_DEFINE(strnlen, rpl_strnlen, + #AC_LIBOBJ([strnlen]) + AC_DEFINE([strnlen], [rpl_strnlen], [Define to rpl_strnlen if the replacement function should be used.]) gl_PREREQ_STRNLEN fi diff --git a/gnulib/m4/strsep.m4 b/gnulib/m4/strsep.m4 index 1231dcb129..887d6889e7 100644 --- a/gnulib/m4/strsep.m4 +++ b/gnulib/m4/strsep.m4 @@ -1,5 +1,5 @@ -# strsep.m4 serial 8 -dnl Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. +# strsep.m4 serial 9 +dnl Copyright (C) 2002, 2003, 2004, 2007, 2009 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. @@ -13,7 +13,7 @@ AC_DEFUN([gl_FUNC_STRSEP], AC_REQUIRE([AC_C_RESTRICT]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) - AC_REPLACE_FUNCS(strsep) + AC_REPLACE_FUNCS([strsep]) if test $ac_cv_func_strsep = no; then HAVE_STRSEP=0 gl_PREREQ_STRSEP diff --git a/gnulib/m4/threadlib.m4 b/gnulib/m4/threadlib.m4 index 51caf576b3..3dd38aa877 100644 --- a/gnulib/m4/threadlib.m4 +++ b/gnulib/m4/threadlib.m4 @@ -1,5 +1,5 @@ -# threadlib.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2005-2008 Free Software Foundation, Inc. +# threadlib.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2005-2009 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. @@ -45,7 +45,7 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY], [AC_REQUIRE([AC_GNU_SOURCE])]) dnl Check for multithreading. m4_divert_text([DEFAULTS], [gl_use_threads_default=]) - AC_ARG_ENABLE(threads, + AC_ARG_ENABLE([threads], AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API]) AC_HELP_STRING([--disable-threads], [build without multithread safety]), [gl_use_threads=$enableval], @@ -131,7 +131,7 @@ AC_DEFUN([gl_THREADLIB_BODY], # pthread_create will actually create a thread. case "$host_os" in solaris* | hpux*) - AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1, + AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1], [Define if the pthread_in_use() detection is hard.]) esac ]) @@ -151,11 +151,11 @@ AC_DEFUN([gl_THREADLIB_BODY], fi if test -n "$gl_have_pthread"; then gl_threads_api=posix - AC_DEFINE([USE_POSIX_THREADS], 1, + AC_DEFINE([USE_POSIX_THREADS], [1], [Define if the POSIX multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_POSIX_THREADS_WEAK], 1, + AC_DEFINE([USE_POSIX_THREADS_WEAK], [1], [Define if references to the POSIX multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -180,10 +180,10 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD=-lthread LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_SOLARIS_THREADS], 1, + AC_DEFINE([USE_SOLARIS_THREADS], [1], [Define if the old Solaris multithreading library can be used.]) if test $gl_have_weak = yes; then - AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1, + AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1], [Define if references to the old Solaris multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -205,11 +205,11 @@ AC_DEFUN([gl_THREADLIB_BODY], LTLIBTHREAD="$LTLIBPTH" LIBMULTITHREAD="$LIBTHREAD" LTLIBMULTITHREAD="$LTLIBTHREAD" - AC_DEFINE([USE_PTH_THREADS], 1, + AC_DEFINE([USE_PTH_THREADS], [1], [Define if the GNU Pth multithreading library can be used.]) if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then if test $gl_have_weak = yes; then - AC_DEFINE([USE_PTH_THREADS_WEAK], 1, + AC_DEFINE([USE_PTH_THREADS_WEAK], [1], [Define if references to the GNU Pth multithreading library should be made weak.]) LIBTHREAD= LTLIBTHREAD= @@ -227,7 +227,7 @@ AC_DEFUN([gl_THREADLIB_BODY], esac }; then gl_threads_api=win32 - AC_DEFINE([USE_WIN32_THREADS], 1, + AC_DEFINE([USE_WIN32_THREADS], [1], [Define if the Win32 multithreading API can be used.]) fi fi diff --git a/gnulib/m4/uintmax_t.m4 b/gnulib/m4/uintmax_t.m4 index cde46d2e8f..734b6933e2 100644 --- a/gnulib/m4/uintmax_t.m4 +++ b/gnulib/m4/uintmax_t.m4 @@ -1,12 +1,12 @@ -# uintmax_t.m4 serial 11 -dnl Copyright (C) 1997-2004, 2007-2008 Free Software Foundation, Inc. +# uintmax_t.m4 serial 12 +dnl Copyright (C) 1997-2004, 2007-2009 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 Paul Eggert. -AC_PREREQ(2.13) +AC_PREREQ([2.13]) # Define uintmax_t to 'unsigned long' or 'unsigned long long' # if it is not already defined in or . @@ -24,7 +24,7 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T], [Define to unsigned long or unsigned long long if and don't define.]) else - AC_DEFINE([HAVE_UINTMAX_T], 1, + AC_DEFINE([HAVE_UINTMAX_T], [1], [Define if you have the 'uintmax_t' type in or .]) fi ]) diff --git a/gnulib/m4/unistd_h.m4 b/gnulib/m4/unistd_h.m4 index 5685273656..ff9a4ea0a5 100644 --- a/gnulib/m4/unistd_h.m4 +++ b/gnulib/m4/unistd_h.m4 @@ -1,5 +1,5 @@ -# unistd_h.m4 serial 16 -dnl Copyright (C) 2006-2008 Free Software Foundation, Inc. +# unistd_h.m4 serial 17 +dnl Copyright (C) 2006-2009 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. @@ -48,6 +48,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], GNULIB_GETPAGESIZE=0; AC_SUBST([GNULIB_GETPAGESIZE]) GNULIB_GETUSERSHELL=0; AC_SUBST([GNULIB_GETUSERSHELL]) GNULIB_LCHOWN=0; AC_SUBST([GNULIB_LCHOWN]) + GNULIB_LINK=0; AC_SUBST([GNULIB_LINK]) GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK]) GNULIB_READLINK=0; AC_SUBST([GNULIB_READLINK]) GNULIB_SLEEP=0; AC_SUBST([GNULIB_SLEEP]) @@ -63,6 +64,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], HAVE_GETHOSTNAME=1; AC_SUBST([HAVE_GETHOSTNAME]) HAVE_GETPAGESIZE=1; AC_SUBST([HAVE_GETPAGESIZE]) HAVE_GETUSERSHELL=1; AC_SUBST([HAVE_GETUSERSHELL]) + HAVE_LINK=1; AC_SUBST([HAVE_LINK]) HAVE_READLINK=1; AC_SUBST([HAVE_READLINK]) HAVE_SLEEP=1; AC_SUBST([HAVE_SLEEP]) HAVE_DECL_ENVIRON=1; AC_SUBST([HAVE_DECL_ENVIRON]) diff --git a/gnulib/m4/vasnprintf.m4 b/gnulib/m4/vasnprintf.m4 index 536258c06b..9e839d2bc8 100644 --- a/gnulib/m4/vasnprintf.m4 +++ b/gnulib/m4/vasnprintf.m4 @@ -1,5 +1,5 @@ -# vasnprintf.m4 serial 25 -dnl Copyright (C) 2002-2004, 2006-2008 Free Software Foundation, Inc. +# vasnprintf.m4 serial 26 +dnl Copyright (C) 2002-2004, 2006-2009 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. @@ -20,7 +20,7 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF], AC_LIBOBJ([printf-parse]) AC_LIBOBJ([asnprintf]) if test $ac_cv_func_vasnprintf = yes; then - AC_DEFINE([REPLACE_VASNPRINTF], 1, + AC_DEFINE([REPLACE_VASNPRINTF], [1], [Define if vasnprintf exists but is overridden by gnulib.]) fi gl_PREREQ_PRINTF_ARGS @@ -58,7 +58,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF], AC_REQUIRE([AC_TYPE_LONG_LONG_INT]) AC_REQUIRE([gt_TYPE_WCHAR_T]) AC_REQUIRE([gt_TYPE_WINT_T]) - AC_CHECK_FUNCS(snprintf wcslen) + AC_CHECK_FUNCS([snprintf wcslen]) dnl Use the _snprintf function only if it is declared (because on NetBSD it dnl is defined as a weak alias of snprintf; we prefer to use the latter). AC_CHECK_DECLS([_snprintf], , , [#include ]) @@ -73,7 +73,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -89,7 +89,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'double' arguments.]) ;; @@ -110,7 +110,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_INFINITE_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for infinite 'long double' arguments.]) ;; @@ -127,7 +127,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], [Define if the vasnprintf implementation needs special code for the 'a' and 'A' directives.]) AC_CHECK_FUNCS([nl_langinfo]) @@ -143,7 +143,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], 1, + AC_DEFINE([NEED_PRINTF_DIRECTIVE_F], [1], [Define if the vasnprintf implementation needs special code for the 'F' directive.]) ;; @@ -158,7 +158,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], 1, + AC_DEFINE([NEED_PRINTF_FLAG_GROUPING], [1], [Define if the vasnprintf implementation needs special code for the ' flag.]) ;; @@ -173,7 +173,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], 1, + AC_DEFINE([NEED_PRINTF_FLAG_LEFTADJUST], [1], [Define if the vasnprintf implementation needs special code for the '-' flag.]) ;; @@ -188,7 +188,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_FLAG_ZERO], 1, + AC_DEFINE([NEED_PRINTF_FLAG_ZERO], [1], [Define if the vasnprintf implementation needs special code for the 0 flag.]) ;; @@ -203,13 +203,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], 1, + AC_DEFINE([NEED_PRINTF_UNBOUNDED_PRECISION], [1], [Define if the vasnprintf implementation needs special code for supporting large precisions without arbitrary bounds.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; @@ -225,13 +225,13 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM], *yes) ;; *) - AC_DEFINE([NEED_PRINTF_ENOMEM], 1, + AC_DEFINE([NEED_PRINTF_ENOMEM], [1], [Define if the vasnprintf implementation needs special code for surviving out-of-memory conditions.]) - AC_DEFINE([NEED_PRINTF_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'double' arguments.]) - AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], 1, + AC_DEFINE([NEED_PRINTF_LONG_DOUBLE], [1], [Define if the vasnprintf implementation needs special code for 'long double' arguments.]) ;; diff --git a/gnulib/m4/wchar_t.m4 b/gnulib/m4/wchar_t.m4 index 3c81564adc..fb27a7f65f 100644 --- a/gnulib/m4/wchar_t.m4 +++ b/gnulib/m4/wchar_t.m4 @@ -1,5 +1,5 @@ -# wchar_t.m4 serial 2 (gettext-0.18) -dnl Copyright (C) 2002-2003, 2008 Free Software Foundation, Inc. +# wchar_t.m4 serial 3 (gettext-0.18) +dnl Copyright (C) 2002-2003, 2008, 2009 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. @@ -15,6 +15,6 @@ AC_DEFUN([gt_TYPE_WCHAR_T], wchar_t foo = (wchar_t)'\0';], , [gt_cv_c_wchar_t=yes], [gt_cv_c_wchar_t=no])]) if test $gt_cv_c_wchar_t = yes; then - AC_DEFINE([HAVE_WCHAR_T], 1, [Define if you have the 'wchar_t' type.]) + AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) fi ]) diff --git a/gnulib/m4/wint_t.m4 b/gnulib/m4/wint_t.m4 index 0026a13188..47a4363d79 100644 --- a/gnulib/m4/wint_t.m4 +++ b/gnulib/m4/wint_t.m4 @@ -1,5 +1,5 @@ -# wint_t.m4 serial 3 (gettext-0.18) -dnl Copyright (C) 2003, 2007-2008 Free Software Foundation, Inc. +# wint_t.m4 serial 4 (gettext-0.18) +dnl Copyright (C) 2003, 2007-2009 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,6 +23,6 @@ AC_DEFUN([gt_TYPE_WINT_T], wint_t foo = (wchar_t)'\0';], , [gt_cv_c_wint_t=yes], [gt_cv_c_wint_t=no])]) if test $gt_cv_c_wint_t = yes; then - AC_DEFINE([HAVE_WINT_T], 1, [Define if you have the 'wint_t' type.]) + AC_DEFINE([HAVE_WINT_T], [1], [Define if you have the 'wint_t' type.]) fi ]) diff --git a/gnulib/tests/Makefile.am b/gnulib/tests/Makefile.am index ea40a21e6e..b1da7680a3 100644 --- a/gnulib/tests/Makefile.am +++ b/gnulib/tests/Makefile.am @@ -212,6 +212,15 @@ EXTRA_DIST += test-poll.c ## end gnulib module poll-tests +## begin gnulib module random_r-tests + +TESTS += test-random_r +check_PROGRAMS += test-random_r + +EXTRA_DIST += test-random_r.c + +## end gnulib module random_r-tests + ## begin gnulib module snprintf-tests TESTS += test-snprintf diff --git a/gnulib/tests/test-random_r.c b/gnulib/tests/test-random_r.c new file mode 100644 index 0000000000..5308f73372 --- /dev/null +++ b/gnulib/tests/test-random_r.c @@ -0,0 +1,56 @@ +/* Test random_r. + Copyright (C) 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 + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +#include +#include +#include +#include + +#define ASSERT(expr) \ + do \ + { \ + if (!(expr)) \ + { \ + fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \ + fflush (stderr); \ + abort (); \ + } \ + } \ + while (0) + +int +main () +{ + struct random_data rand_state; + char buf[128]; + unsigned int i; + unsigned int n_big = 0; + + rand_state.state = NULL; + if (initstate_r (time (NULL), buf, sizeof buf, &rand_state)) + return 1; + for (i = 0; i < 1000; i++) + { + int32_t r; + ASSERT (random_r (&rand_state, &r) == 0); + ASSERT (0 <= r); + if (RAND_MAX / 2 < r) + ++n_big; + } + + /* Fail if none of the numbers were larger than RAND_MAX / 2. */ + return !n_big; +} diff --git a/gnulib/tests/test-unistd.c b/gnulib/tests/test-unistd.c index dc15bda0df..5fed15cf9f 100644 --- a/gnulib/tests/test-unistd.c +++ b/gnulib/tests/test-unistd.c @@ -1,5 +1,5 @@ /* Test of substitute. - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007, 2009 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 @@ -23,6 +23,12 @@ /* Check that the various SEEK_* macros are defined. */ int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET }; +/* Check that the various *_FILENO macros are defined. */ +#if ! (defined STDIN_FILENO \ + && (STDIN_FILENO + STDOUT_FILENO + STDERR_FILENO == 3)) +missing or broken *_FILENO macros +#endif + /* Check that the types are all defined. */ size_t t1; ssize_t t2;