]> xenbits.xensource.com Git - libvirt.git/commitdiff
Update from gnulib.
authorJim Meyering <meyering@redhat.com>
Mon, 14 Jan 2008 14:07:25 +0000 (14:07 +0000)
committerJim Meyering <meyering@redhat.com>
Mon, 14 Jan 2008 14:07:25 +0000 (14:07 +0000)
19 files changed:
ChangeLog
gnulib/lib/Makefile.am
gnulib/lib/float.in.h
gnulib/lib/fseeko.c
gnulib/lib/printf-parse.c
gnulib/lib/stdint.in.h
gnulib/lib/stdio.in.h
gnulib/lib/stdlib.in.h
gnulib/lib/string.in.h
gnulib/lib/unistd.in.h
gnulib/lib/vasnprintf.h
gnulib/m4/alloca.m4
gnulib/m4/float_h.m4
gnulib/m4/gnulib-comp.m4
gnulib/m4/stdlib_h.m4
gnulib/m4/string_h.m4
gnulib/m4/unistd_h.m4
gnulib/tests/Makefile.am
gnulib/tests/test-fseeko.c

index b151ba5f1fee1beab8343ebba00c2ed244deb1f4..3f720a06ab9c9f6161d2220e64dfa49555d2b48c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,25 @@
 2008-01-14  Jim Meyering  <meyering@redhat.com>
 
+       Update files from gnulib.
+       * gnulib/lib/Makefile.am: Update.
+       * gnulib/lib/float.in.h: Likewise.
+       * gnulib/lib/fseeko.c: Likewise.
+       * gnulib/lib/printf-parse.c: Likewise.
+       * gnulib/lib/stdint.in.h: Likewise.
+       * gnulib/lib/stdio.in.h: Likewise.
+       * gnulib/lib/stdlib.in.h: Likewise.
+       * gnulib/lib/string.in.h: Likewise.
+       * gnulib/lib/unistd.in.h: Likewise.
+       * gnulib/lib/vasnprintf.h: Likewise.
+       * gnulib/m4/alloca.m4: Likewise.
+       * gnulib/m4/float_h.m4: Likewise.
+       * gnulib/m4/gnulib-comp.m4: Likewise.
+       * gnulib/m4/stdlib_h.m4: Likewise.
+       * gnulib/m4/string_h.m4: Likewise.
+       * gnulib/m4/unistd_h.m4: Likewise.
+       * gnulib/tests/Makefile.am: Likewise.
+       * gnulib/tests/test-fseeko.c: Likewise.
+
        Clean up the global name space.
        * src/qemu_conf.c: Add "static" and "const" attributes to some globals.
        * src/qemu_conf.h: Update a declaration.
@@ -77,7 +97,7 @@ Thu Jan 10 13:51:00 GMT 2008 Mark McLoughlin <markmc@redhat.com>
 Thu Jan 10 13:50:11 GMT 2008 Mark McLoughlin <markmc@redhat.com>
 
        * src/iptables.c: Re-name the "flipflop" variable to "command_idx"
-       
+
 Thu Jan 10 13:49:01 GMT 2008 Mark McLoughlin <markmc@redhat.com>
 
        * src/iptables.c:  make use of virFileMakePath(),
index a94ed2d43d25dca529d4babe6305a86440f3a274..e7a6edfd6c442de455de5ed65960d36ac042e971 100644 (file)
@@ -420,13 +420,18 @@ stdlib.h: stdlib.in.h
              -e 's|@''GNULIB_MKDTEMP''@|$(GNULIB_MKDTEMP)|g' \
              -e 's|@''GNULIB_MKSTEMP''@|$(GNULIB_MKSTEMP)|g' \
              -e 's|@''GNULIB_PUTENV''@|$(GNULIB_PUTENV)|g' \
+             -e 's|@''GNULIB_SETENV''@|$(GNULIB_SETENV)|g' \
+             -e 's|@''GNULIB_UNSETENV''@|$(GNULIB_UNSETENV)|g' \
              -e 's|@''HAVE_CALLOC_POSIX''@|$(HAVE_CALLOC_POSIX)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
              -e 's|@''HAVE_MALLOC_POSIX''@|$(HAVE_MALLOC_POSIX)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_REALLOC_POSIX''@|$(HAVE_REALLOC_POSIX)|g' \
+             -e 's|@''HAVE_SETENV''@|$(HAVE_SETENV)|g' \
+             -e 's|@''HAVE_UNSETENV''@|$(HAVE_UNSETENV)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
+             -e 's|@''VOID_UNSETENV''@|$(VOID_UNSETENV)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/stdlib.in.h; \
        } > $@-t
@@ -482,9 +487,11 @@ string.h: string.in.h
              -e 's|@''GNULIB_STRNLEN''@|$(GNULIB_STRNLEN)|g' \
              -e 's|@''GNULIB_STRPBRK''@|$(GNULIB_STRPBRK)|g' \
              -e 's|@''GNULIB_STRSEP''@|$(GNULIB_STRSEP)|g' \
+             -e 's|@''GNULIB_STRSTR''@|$(GNULIB_STRSTR)|g' \
              -e 's|@''GNULIB_STRCASESTR''@|$(GNULIB_STRCASESTR)|g' \
              -e 's|@''GNULIB_STRTOK_R''@|$(GNULIB_STRTOK_R)|g' \
              -e 's|@''GNULIB_STRERROR''@|$(GNULIB_STRERROR)|g' \
+             -e 's|@''GNULIB_STRSIGNAL''@|$(GNULIB_STRSIGNAL)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -500,6 +507,9 @@ string.h: string.in.h
              -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
              -e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
+             -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
+             -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
              -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/string.in.h; \
@@ -677,6 +687,7 @@ unistd.h: unistd.in.h
              -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_FCHDIR''@|$(REPLACE_FCHDIR)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
+             -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LSEEK''@|$(REPLACE_LSEEK)|g' \
              < $(srcdir)/unistd.in.h; \
index 7cf07915fa535e90b5a75b61fea6be62c7b37221..1984fd7342855cca003d9a92daba696125d390ba 100644 (file)
@@ -24,7 +24,7 @@
 #define _GL_FLOAT_H
 
 /* 'long double' properties.  */
-#if defined __i386__ && defined __BEOS__
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
 /* Number of mantissa units, in base FLT_RADIX.  */
 # undef LDBL_MANT_DIG
 # define LDBL_MANT_DIG   64
index c66ba263bddda50b855f3d2a779a156527f749e3..8543d429edb485473f18c00c57bed5238d53222f 100644 (file)
@@ -111,6 +111,9 @@ rpl_fseeko (FILE *fp, off_t offset, int whence)
 #if defined __sferror               /* FreeBSD, NetBSD, OpenBSD, MacOS X, Cygwin */
          fp->_offset = pos;
          fp->_flags |= __SOFF;
+         fp->_flags &= ~__SEOF;
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, mingw */
+          fp->_flag &= ~_IOEOF;
 #endif
          return 0;
        }
index 94c6c61328b77c344262998bd6574d2f7b5c1348..66b45a73f271f689a20b085f30c2e13b6cfb3f50 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -392,6 +392,44 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                        }
                      cp++;
                    }
+#if defined __APPLE__ && defined __MACH__
+                 /* On MacOS X 10.3, PRIdMAX is defined as "qd".
+                    We cannot change it to "lld" because PRIdMAX must also
+                    be understood by the system's printf routines.  */
+                 else if (*cp == 'q')
+                   {
+                     if (64 / 8 > sizeof (long))
+                       {
+                         /* int64_t = long long */
+                         flags += 16;
+                       }
+                     else
+                       {
+                         /* int64_t = long */
+                         flags += 8;
+                       }
+                     cp++;
+                   }
+#endif
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+                 /* On native Win32, PRIdMAX is defined as "I64d".
+                    We cannot change it to "lld" because PRIdMAX must also
+                    be understood by the system's printf routines.  */
+                 else if (*cp == 'I' && cp[1] == '6' && cp[2] == '4')
+                   {
+                     if (64 / 8 > sizeof (long))
+                       {
+                         /* __int64 = long long */
+                         flags += 16;
+                       }
+                     else
+                       {
+                         /* __int64 = long */
+                         flags += 8;
+                       }
+                     cp += 3;
+                   }
+#endif
                  else
                    break;
                }
index af316488d40971023d2df81f7f49d0c6ff0186ea..fbe39c5447df72b9d6bec73c0977b28bf7347966 100644 (file)
 
 #ifndef _GL_STDINT_H
 
+/* When including a system file that in turn includes <inttypes.h>,
+   use the system <inttypes.h>, not our substitute.  This avoids
+   problems with (for example) VMS, whose <sys/bitypes.h> includes
+   <inttypes.h>.  */
+#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
 /* Get those types that are already defined in other system include
    files, so that we can "#define int8_t signed char" below without
    worrying about a later system include file containing a "typedef
@@ -66,9 +72,7 @@
   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
      <inttypes.h> also defines intptr_t and uintptr_t.  */
-# define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 # include <inttypes.h>
-# undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
 #elif @HAVE_SYS_INTTYPES_H@
   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
@@ -91,6 +95,8 @@
 
 #endif
 
+#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
+
 /* Minimum and maximum values for a integer type under the usual assumption.
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
index b17642438dd2ed96ac6728fe096dd314a8fd0077..d5962aa4fc02a70df351ad8bfaf73f81faa13dfe 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -45,7 +45,7 @@
 
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
 #  define __attribute__(Spec) /* empty */
 # endif
 /* The __-protected variants of `format' and `printf' attributes
index baebcce9737a610a5f84e68fe577deffb3d4dcf5..bc7dc4f9a31bd227944a62d71047a32e26bbfaab 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2002, 2006-2007 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2007 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
@@ -176,6 +176,29 @@ extern int putenv (char *string);
 #endif
 
 
+#if @GNULIB_SETENV@
+# if !@HAVE_SETENV@
+/* Set NAME to VALUE in the environment.
+   If REPLACE is nonzero, overwrite an existing value.  */
+extern int setenv (const char *name, const char *value, int replace);
+# endif
+#endif
+
+
+#if @GNULIB_UNSETENV@
+# if @HAVE_UNSETENV@
+#  if @VOID_UNSETENV@
+/* On some systems, unsetenv() returns void.
+   This is the case for MacOS X 10.3, FreeBSD 4.8, NetBSD 1.6, OpenBSD 3.4.  */
+#   define unsetenv(name) ((unsetenv)(name), 0)
+#  endif
+# else
+/* Remove the variable NAME from the environment.  */
+extern int unsetenv (const char *name);
+# endif
+#endif
+
+
 #ifdef __cplusplus
 }
 #endif
index a371e5c696ad3e446830ceec1a80b62b3985ecda..dbbe2fd7af5426bf0746a76d201c8a33b157d14e 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2007 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
 #define _GL_STRING_H
 
 
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
+#  define __attribute__(Spec) /* empty */
+# endif
+/* The attribute __pure__ was added in gcc 2.96.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
+#  define __pure__ /* empty */
+# endif
+#endif
+
+
 /* The definition of GL_LINK_WARNING is copied here.  */
 
 
@@ -35,15 +47,20 @@ extern "C" {
 
 /* Return the first occurrence of NEEDLE in HAYSTACK.  */
 #if @GNULIB_MEMMEM@
-# if ! @HAVE_DECL_MEMMEM@
+# if @REPLACE_MEMMEM@
+#  define memmem rpl_memmem
+# endif
+# if ! @HAVE_DECL_MEMMEM@ || @REPLACE_MEMMEM@
 extern void *memmem (void const *__haystack, size_t __haystack_len,
-                    void const *__needle, size_t __needle_len);
+                    void const *__needle, size_t __needle_len)
+  __attribute__ ((__pure__));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memmem
 # define memmem(a,al,b,bl) \
-    (GL_LINK_WARNING ("memmem is unportable - " \
-                      "use gnulib module memmem for portability"), \
+    (GL_LINK_WARNING ("memmem is unportable and often quadratic - " \
+                      "use gnulib module memmem-simple for portability, " \
+                      "and module memmem for speed" ), \
      memmem (a, al, b, bl))
 #endif
 
@@ -65,7 +82,8 @@ extern void *mempcpy (void *restrict __dest, void const *restrict __src,
 /* Search backwards through a block for a byte (specified as an int).  */
 #if @GNULIB_MEMRCHR@
 # if ! @HAVE_DECL_MEMRCHR@
-extern void *memrchr (void const *, int, size_t);
+extern void *memrchr (void const *, int, size_t)
+  __attribute__ ((__pure__));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef memrchr
@@ -118,7 +136,8 @@ extern char *stpncpy (char *restrict __dst, char const *restrict __src,
 /* Find the first occurrence of C in S or the final NUL byte.  */
 #if @GNULIB_STRCHRNUL@
 # if ! @HAVE_STRCHRNUL@
-extern char *strchrnul (char const *__s, int __c_in);
+extern char *strchrnul (char const *__s, int __c_in)
+  __attribute__ ((__pure__));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strchrnul
@@ -163,7 +182,8 @@ extern char *strndup (char const *__string, size_t __n);
    return MAXLEN.  */
 #if @GNULIB_STRNLEN@
 # if ! @HAVE_DECL_STRNLEN@
-extern size_t strnlen (char const *__string, size_t __maxlen);
+extern size_t strnlen (char const *__string, size_t __maxlen)
+  __attribute__ ((__pure__));
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strnlen
@@ -189,7 +209,8 @@ extern size_t strnlen (char const *__string, size_t __maxlen);
 /* Find the first occurrence in S of any character in ACCEPT.  */
 #if @GNULIB_STRPBRK@
 # if ! @HAVE_STRPBRK@
-extern char *strpbrk (char const *__s, char const *__accept);
+extern char *strpbrk (char const *__s, char const *__accept)
+  __attribute__ ((__pure__));
 # endif
 # if defined GNULIB_POSIXCHECK
 /* strpbrk() assumes the second argument is a list of single-byte characters.
@@ -269,23 +290,32 @@ extern char *strsep (char **restrict __stringp, char const *restrict __delim);
      strsep (s, d))
 #endif
 
-#if defined GNULIB_POSIXCHECK
+#if @GNULIB_STRSTR@
+# if @REPLACE_STRSTR@
+#  define strstr rpl_strstr
+char *strstr (const char *haystack, const char *needle)
+  __attribute__ ((__pure__));
+# endif
+#elif defined GNULIB_POSIXCHECK
 /* strstr() does not work with multibyte strings if the locale encoding is
    different from UTF-8:
    POSIX says that it operates on "strings", and "string" in POSIX is defined
    as a sequence of bytes, not of characters.  */
 # undef strstr
 # define strstr(a,b) \
-    (GL_LINK_WARNING ("strstr cannot work correctly on character strings " \
-                      "in most multibyte locales - " \
-                      "use mbsstr if you care about internationalization"), \
+    (GL_LINK_WARNING ("strstr is quadratic on many systems, and cannot " \
+                      "work correctly on character strings in most "    \
+                      "multibyte locales - " \
+                      "use mbsstr if you care about internationalization, " \
+                      "or use strstr if you care about speed"), \
      strstr (a, b))
 #endif
 
 /* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
    comparison.  */
 #if ! @HAVE_STRCASESTR@
-extern char *strcasestr (const char *haystack, const char *needle);
+extern char *strcasestr (const char *haystack, const char *needle)
+  __attribute__ ((__pure__));
 #endif
 #if defined GNULIB_POSIXCHECK
 /* strcasestr() does not work with multibyte strings:
@@ -511,6 +541,18 @@ extern char *strerror (int);
      strerror (e))
 #endif
 
+#if @GNULIB_STRSIGNAL@
+# if ! @HAVE_DECL_STRSIGNAL@
+extern char *strsignal (int __sig);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef strsignal
+# define strsignal(a) \
+    (GL_LINK_WARNING ("strsignal is unportable - " \
+                      "use gnulib module strsignal for portability"), \
+     strsignal (a))
+#endif
+
 
 #ifdef __cplusplus
 }
index 4916f75cedbb8d2d32ed792dee59af31777fa7e3..10678f4c997049e31577b69e63251e7c7ef73ffe 100644 (file)
@@ -181,7 +181,10 @@ extern int getlogin_r (char *name, size_t size);
 
 
 #if @GNULIB_GETPAGESIZE@
-# if !@HAVE_GETPAGESIZE@
+# if @REPLACE_GETPAGESIZE@
+#  define getpagesize rpl_getpagesize
+extern int getpagesize (void);
+# elif !@HAVE_GETPAGESIZE@
 /* This is for POSIX systems.  */
 #  if !defined getpagesize && defined _SC_PAGESIZE
 #   if ! (defined __VMS && __VMS_VER < 70000000)
index 4524ce77ff17e57decf6301e20aa4ed634727590..7f5770aaf4ade306dc8269d71828f0361d3c5a6b 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2008 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@
 
 #ifndef __attribute__
 /* This feature is available in gcc versions 2.5 and later.  */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
 #  define __attribute__(Spec) /* empty */
 # endif
 /* The __-protected variants of `format' and `printf' attributes
index eb62e0e7a52f16787cd5ac5084def332d5874aed..95f54a6d48c08452ba0f2eaef811c72ce2748825 100644 (file)
@@ -1,5 +1,5 @@
-# alloca.m4 serial 7
-dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
+# alloca.m4 serial 8
+dnl Copyright (C) 2002-2004, 2006, 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -39,10 +39,6 @@ AC_DEFUN([gl_FUNC_ALLOCA],
     ALLOCA_H=alloca.h
   fi
   AC_SUBST([ALLOCA_H])
-
-  AC_DEFINE(HAVE_ALLOCA_H, 1,
-    [Define HAVE_ALLOCA_H for backward compatibility with older code
-     that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
 ])
 
 # Prerequisites of lib/alloca.c.
index 1b1ad103e984483e9d742a65c68fff39671f7d32..d36e3a46caef916dfd5d0c4dd26182d70850b3ae 100644 (file)
@@ -1,4 +1,4 @@
-# float_h.m4 serial 2
+# float_h.m4 serial 3
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FLOAT_H],
   AC_REQUIRE([AC_CANONICAL_HOST])
   FLOAT_H=
   case "$host_os" in
-    beos*)
+    beos* | openbsd*)
       FLOAT_H=float.h
       gl_CHECK_NEXT_HEADERS([float.h])
       ;;
index d92a377dab84f5f4da7e21134b19ae09a57f27d9..1b91a1ef3d1e625bef4b02b45bb63547e79aaff1 100644 (file)
@@ -157,6 +157,13 @@ AC_DEFUN([gl_LIBOBJ], [
   gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
 ])
 
+# m4_foreach_w is provided by autoconf-2.59c and later.
+# This definition is to accommodate developers using versions
+# of autoconf older than that.
+m4_ifndef([m4_foreach_w],
+  [m4_define([m4_foreach_w],
+    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
+
 # Like AC_REPLACE_FUNCS, except that the module name goes
 # into gl_LIBOBJS instead of into LIBOBJS.
 AC_DEFUN([gl_REPLACE_FUNCS], [
@@ -185,6 +192,13 @@ AC_DEFUN([gltests_LIBOBJ], [
   gltests_LIBOBJS="$gltests_LIBOBJS $1.$ac_objext"
 ])
 
+# m4_foreach_w is provided by autoconf-2.59c and later.
+# This definition is to accommodate developers using versions
+# of autoconf older than that.
+m4_ifndef([m4_foreach_w],
+  [m4_define([m4_foreach_w],
+    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
+
 # Like AC_REPLACE_FUNCS, except that the module name goes
 # into gltests_LIBOBJS instead of into LIBOBJS.
 AC_DEFUN([gltests_REPLACE_FUNCS], [
index 278df744c79398c18816d65b467877f050b7b5c4..fe4ce122e9fd6208b66887a6fa4cce06db8914d6 100644 (file)
@@ -1,4 +1,4 @@
-# stdlib_h.m4 serial 4
+# stdlib_h.m4 serial 5
 dnl Copyright (C) 2007 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,12 +26,17 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
   GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
   GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
+  GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
+  GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_CALLOC_POSIX=1;    AC_SUBST([HAVE_CALLOC_POSIX])
   HAVE_GETSUBOPT=1;       AC_SUBST([HAVE_GETSUBOPT])
   HAVE_MALLOC_POSIX=1;    AC_SUBST([HAVE_MALLOC_POSIX])
   HAVE_MKDTEMP=1;         AC_SUBST([HAVE_MKDTEMP])
   HAVE_REALLOC_POSIX=1;   AC_SUBST([HAVE_REALLOC_POSIX])
+  HAVE_SETENV=1;          AC_SUBST([HAVE_SETENV])
+  HAVE_UNSETENV=1;        AC_SUBST([HAVE_UNSETENV])
   REPLACE_MKSTEMP=0;      AC_SUBST([REPLACE_MKSTEMP])
   REPLACE_PUTENV=0;       AC_SUBST([REPLACE_PUTENV])
+  VOID_UNSETENV=0;        AC_SUBST([VOID_UNSETENV])
 ])
index 83711799a1d893014e810a721724f8c253d8b320..69761d720d332ac94373a55e6783a30c90319723 100644 (file)
@@ -1,10 +1,12 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008 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.
 
+# serial 3
+
 # Written by Paul Eggert.
 
 AC_DEFUN([gl_HEADER_STRING_H],
@@ -41,6 +43,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
   GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
   GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
+  GNULIB_STRSTR=0;      AC_SUBST([GNULIB_STRSTR])
   GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
   GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
   GNULIB_MBSLEN=0;      AC_SUBST([GNULIB_MBSLEN])
@@ -58,6 +61,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
   GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
   GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
+  GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
@@ -74,5 +78,8 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   HAVE_STRCASESTR=1;           AC_SUBST([HAVE_STRCASESTR])
   HAVE_DECL_STRTOK_R=1;                AC_SUBST([HAVE_DECL_STRTOK_R])
   HAVE_DECL_STRERROR=1;                AC_SUBST([HAVE_DECL_STRERROR])
+  HAVE_DECL_STRSIGNAL=1;       AC_SUBST([HAVE_DECL_STRSIGNAL])
   REPLACE_STRERROR=0;          AC_SUBST([REPLACE_STRERROR])
+  REPLACE_MEMMEM=0;            AC_SUBST([REPLACE_MEMMEM])
+  REPLACE_STRSTR=0;            AC_SUBST([REPLACE_STRSTR])
 ])
index 91c02e7c834a90afde93bb9086522d373b5766ed..4b8857ca5bba04f307e39ac3fec537b3855f336c 100644 (file)
@@ -55,6 +55,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
   REPLACE_FCHDIR=0;       AC_SUBST([REPLACE_FCHDIR])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
+  REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_LSEEK=0;        AC_SUBST([REPLACE_LSEEK])
 ])
index db70ba182612a76111037e99006333d25b840fb3..4dae90d32284b61a2690a9d492421e006a607d06 100644 (file)
@@ -34,12 +34,13 @@ AM_CPPFLAGS = \
   -I../.. -I$(srcdir)/../.. \
   -I../../gnulib/lib -I$(srcdir)/../../gnulib/lib
 
-LDADD = libtests.a $(LIBTESTS_LIBDEPS) ../../gnulib/lib/libgnu.la
+LDADD = libtests.a ../../gnulib/lib/libgnu.la libtests.a $(LIBTESTS_LIBDEPS)
 
 libtests_a_SOURCES =
 libtests_a_LIBADD = $(gltests_LIBOBJS)
 libtests_a_DEPENDENCIES = $(gltests_LIBOBJS)
 EXTRA_libtests_a_SOURCES =
+AM_LIBTOOLFLAGS = --preserve-dup-deps
 
 ## begin gnulib module alloca-opt-tests
 
index bcafeea0a367321d61d98ff06027d03a40803bb6..25289cef06c9d5d94b7c2261330d5631be1ebfaa 100644 (file)
 int
 main (int argc, char **argv)
 {
-  /* Assume stdin is seekable iff argc > 1.  */
+  /* Assume stdin is non-empty and seekable iff argc > 1.  */
   int expected = argc > 1 ? 0 : -1;
   /* Exit with success only if fseek/fseeko agree.  */
   int r1 = fseeko (stdin, (off_t)0, SEEK_CUR);
   int r2 = fseek (stdin, (long)0, SEEK_CUR);
-  return ! (r1 == r2 && r1 == expected);
+  if (r1 != r2 || r1 != expected)
+    return 1;
+  if (argc > 1)
+    {
+      /* Test that fseek discards ungetc data.  */
+      int ch = fgetc (stdin);
+      if (ch == EOF)
+        return 1;
+      if (ungetc (ch ^ 0xff, stdin) != (ch ^ 0xff))
+        return 1;
+      if (fseeko (stdin, (off_t) 0, SEEK_END))
+        return 1;
+      if (fgetc (stdin) != EOF)
+        return 1;
+      /* Test that fseek resets end-of-file marker.  */
+      if (!feof (stdin))
+        return 1;
+      if (fseeko (stdin, (off_t) 0, SEEK_END))
+        return 1;
+      if (feof (stdin))
+        return 1;
+    }
+  return 0;
 }