]> git.saurik.com Git - bison.git/commitdiff
Upgrade to today's gnulib.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Jun 2003 19:41:07 +0000 (19:41 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 16 Jun 2003 19:41:07 +0000 (19:41 +0000)
13 files changed:
lib/dirname.c
lib/dirname.h
lib/hash.c
lib/hash.h
lib/malloc.c
lib/obstack.h
lib/quote.c
lib/realloc.c
lib/strcasecmp.c
lib/xalloc.h
m4/alloca.m4
m4/onceonly.m4
m4/quote.m4

index 9fb5f09374d1ce1c232e5ad18263cfbe763954a2..131af8bbdb0e9987b98070f0d6dee6ef26648623 100644 (file)
@@ -1,5 +1,5 @@
 /* dirname.c -- return all but the last element in a path
 /* dirname.c -- return all but the last element in a path
-   Copyright 1990, 1998, 2000, 2001 Free Software Foundation, Inc.
+   Copyright 1990, 1998, 2000, 2001, 2003 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
 
    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
@@ -67,9 +67,13 @@ dir_name (char const *path)
 
 Run the test like this (expect no output):
   gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \
 
 Run the test like this (expect no output):
   gcc -DHAVE_CONFIG_H -DTEST_DIRNAME -I.. -O -Wall \
-     basename.c dirname.c xmalloc.c
+     basename.c dirname.c xmalloc.c error.c
   sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
 
   sed -n '/^BEGIN-DATA$/,/^END-DATA$/p' dirname.c|grep -v DATA|./a.out
 
+If it's been built on a DOS or Windows platforms, run another test like
+this (again, expect no output):
+  sed -n '/^BEGIN-DOS-DATA$/,/^END-DOS-DATA$/p' dirname.c|grep -v DATA|./a.out
+
 BEGIN-DATA
 foo//// .
 bar/foo//// bar
 BEGIN-DATA
 foo//// .
 bar/foo//// bar
@@ -79,16 +83,28 @@ foo/ .
 a .
 END-DATA
 
 a .
 END-DATA
 
+BEGIN-DOS-DATA
+c:///// c:/
+c:/ c:/
+c:/. c:/
+c:foo c:.
+c:foo/bar c:foo
+END-DOS-DATA
+
 */
 
 # define MAX_BUFF_LEN 1024
 # include <stdio.h>
 
 */
 
 # define MAX_BUFF_LEN 1024
 # include <stdio.h>
 
+char *program_name;
+
 int
 int
-main ()
+main (int argc, char *argv[])
 {
   char buff[MAX_BUFF_LEN + 1];
 
 {
   char buff[MAX_BUFF_LEN + 1];
 
+  program_name = argv[0];
+
   buff[MAX_BUFF_LEN] = 0;
   while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
     {
   buff[MAX_BUFF_LEN] = 0;
   while (fgets (buff, MAX_BUFF_LEN, stdin) && buff[0])
     {
index cea14c04ff479f51bc7635a847e476b0ec118fcc..4f794ee4840aff2ee4d577fa06e05dcb7b097b30 100644 (file)
@@ -17,6 +17,8 @@
 #ifndef DIRNAME_H_
 # define DIRNAME_H_ 1
 
 #ifndef DIRNAME_H_
 # define DIRNAME_H_ 1
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index d73bb6b26e96775cc3812181f1aaf38a170a6248..7373a011ceceef9f94faa1c5a55d1409139b7e52 100644 (file)
@@ -31,6 +31,7 @@
 # include <stdlib.h>
 #endif
 
 # include <stdlib.h>
 #endif
 
+#include <limits.h>
 #include <stdbool.h>
 #include <stdio.h>
 
 #include <stdbool.h>
 #include <stdio.h>
 
@@ -403,9 +404,6 @@ hash_do_for_each (const Hash_table *table, Hash_processor processor,
 unsigned
 hash_string (const char *string, unsigned n_buckets)
 {
 unsigned
 hash_string (const char *string, unsigned n_buckets)
 {
-# ifndef CHAR_BIT
-#  define CHAR_BIT 8
-# endif
 # define ROTATE_LEFT(Value, Shift) \
   ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
 # define HASH_ONE_CHAR(Value, Byte) \
 # define ROTATE_LEFT(Value, Shift) \
   ((Value) << (Shift) | (Value) >> ((sizeof (unsigned) * CHAR_BIT) - (Shift)))
 # define HASH_ONE_CHAR(Value, Byte) \
index a9fc187606a82d5ca1079772ed0e207de27f429f..b5537fa8dbb61ca3de3149dc13c532e177b20bed 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef HASH_H_
 # define HASH_H_
 
 #ifndef HASH_H_
 # define HASH_H_
 
+# include <stdio.h>
+
 # ifndef PARAMS
 #  if PROTOTYPES || __STDC__
 #   define PARAMS(Args) Args
 # ifndef PARAMS
 #  if PROTOTYPES || __STDC__
 #   define PARAMS(Args) Args
index 5e7674bd47d541f17348164f049d3122f17f1ea9..bcd6b564b07abf5d41a5d1faeca6ecb3aa6e29ae 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 #undef malloc
 
 #endif
 #undef malloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 
 
 char *malloc ();
 
index 7a0ee1128c04cbec97b17b837e9c80eaedda58b4..c0fc9ac641d4c8ee14070939012799b3ddbead2f 100644 (file)
@@ -372,12 +372,12 @@ extern int obstack_exit_failure;
 
 # define obstack_object_size(OBSTACK)                                  \
   __extension__                                                                \
 
 # define obstack_object_size(OBSTACK)                                  \
   __extension__                                                                \
-  ({ struct obstack *__o = (OBSTACK);                                  \
+  ({ struct obstack const *__o = (OBSTACK);                            \
      (unsigned) (__o->next_free - __o->object_base); })
 
 # define obstack_room(OBSTACK)                                         \
   __extension__                                                                \
      (unsigned) (__o->next_free - __o->object_base); })
 
 # define obstack_room(OBSTACK)                                         \
   __extension__                                                                \
-  ({ struct obstack *__o = (OBSTACK);                                  \
+  ({ struct obstack const *__o = (OBSTACK);                            \
      (unsigned) (__o->chunk_limit - __o->next_free); })
 
 # define obstack_make_room(OBSTACK,length)                             \
      (unsigned) (__o->chunk_limit - __o->next_free); })
 
 # define obstack_make_room(OBSTACK,length)                             \
@@ -390,7 +390,7 @@ __extension__                                                               \
 
 # define obstack_empty_p(OBSTACK)                                      \
   __extension__                                                                \
 
 # define obstack_empty_p(OBSTACK)                                      \
   __extension__                                                                \
-  ({ struct obstack *__o = (OBSTACK);                                  \
+  ({ struct obstack const *__o = (OBSTACK);                            \
      (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
 
 # define obstack_grow(OBSTACK,where,length)                            \
      (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
 
 # define obstack_grow(OBSTACK,where,length)                            \
index 3cbc08052dda28b1c86e78644ffe496b21337247..5f11d836b3c3fa204b49e11d30354d6419d06346 100644 (file)
@@ -1,5 +1,5 @@
 /* quote.c - quote arguments for output
 /* quote.c - quote arguments for output
-   Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2001, 2003 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
 
    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
 # include <config.h>
 #endif
 
 # include <config.h>
 #endif
 
-#if HAVE_STDDEF_H
-# include <stddef.h>  /* For the definition of size_t on windows w/MSVC.  */
-#endif
-#include <sys/types.h>
 #include "quotearg.h"
 #include "quote.h"
 
 #include "quotearg.h"
 #include "quote.h"
 
-/* Return an unambiguous printable representated, allocated in slot N,
-   for NAME, suitable for diagnostics.  */
+/* Return an unambiguous printable representation of NAME,
+   allocated in slot N, suitable for diagnostics.  */
 char const *
 quote_n (int n, char const *name)
 {
   return quotearg_n_style (n, locale_quoting_style, name);
 }
 
 char const *
 quote_n (int n, char const *name)
 {
   return quotearg_n_style (n, locale_quoting_style, name);
 }
 
-/* Return an unambiguous printable representation of NAME, suitable
-   for diagnostics.  */
+/* Return an unambiguous printable representation of NAME,
+   suitable for diagnostics.  */
 char const *
 quote (char const *name)
 {
 char const *
 quote (char const *name)
 {
index d0d3e4ab07c242e9ca96710be79c703bd181895b..5c94a0a25c67af5a461db5274291b4204495aa3b 100644 (file)
@@ -22,7 +22,7 @@
 #endif
 #undef realloc
 
 #endif
 #undef realloc
 
-#include <sys/types.h>
+#include <stddef.h>
 
 char *malloc ();
 char *realloc ();
 
 char *malloc ();
 char *realloc ();
index ae7601de0fcf9d6d3d1ad547705ec769c1ba6b93..cf4ab88dbdf04448b73d8507f1cbe142d15f67e8 100644 (file)
@@ -29,7 +29,7 @@
 # define LENGTH_LIMIT_EXPR(Expr) 0
 #endif
 
 # define LENGTH_LIMIT_EXPR(Expr) 0
 #endif
 
-#include <sys/types.h>
+#include <stddef.h>
 #include <ctype.h>
 
 #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
 #include <ctype.h>
 
 #define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch))
index 098a6c2e0730aaccda487400d1d51893257452f2..5b623da2039b29096b4d05094940b8052b453460 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef XALLOC_H_
 # define XALLOC_H_
 
 #ifndef XALLOC_H_
 # define XALLOC_H_
 
+# include <stddef.h>
+
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
 # ifndef PARAMS
 #  if defined PROTOTYPES || (defined __STDC__ && __STDC__)
 #   define PARAMS(Args) Args
index 3a4ee7ed49b00f91d1bb866d38885ff54f133b52..4df039d203f256dde10b87b4177aaea64e787f9e 100644 (file)
@@ -1,4 +1,4 @@
-# alloca.m4 serial 2
+# alloca.m4 serial 2 (gettext-0.12)
 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
index af56aa94484661e3adc151f26b52c77eb1a07606..50b33f489fe9f86762b06d7e4af2ed6993c4d4d7 100644 (file)
@@ -1,4 +1,4 @@
-# onceonly.m4 serial 2
+# onceonly.m4 serial 3 (gettext-0.12)
 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -21,20 +21,20 @@ dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
 dnl function.
 
 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
 dnl function.
 
-dnl Taken from Autoconf 2.50; can be removed once we assume 2.50 or later.
-define([m4_quote], [[$*]])
+dnl Autoconf version 2.57 or newer is recommended.
+AC_PREREQ(2.54)
 
 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
   :
   AC_FOREACH([gl_HEADER_NAME], [$1], [
 
 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
   :
   AC_FOREACH([gl_HEADER_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
-                                                [-./], [___])), [
+    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(m4_defn([gl_HEADER_NAME]),
+                                                 [-./], [___])), [
       AC_CHECK_HEADERS(gl_HEADER_NAME)
     ])
     AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
       AC_CHECK_HEADERS(gl_HEADER_NAME)
     ])
     AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
-                                                  [-./], [___])))
+                                                   [-./], [___])))
   ])
 ])
 
   ])
 ])
 
@@ -43,10 +43,10 @@ AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
   :
   AC_FOREACH([gl_FUNC_NAME], [$1], [
 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
   :
   AC_FOREACH([gl_FUNC_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
-      AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
+    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
+      AC_CHECK_FUNCS(m4_defn([gl_FUNC_NAME]))
     ])
     ])
-    AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
+    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
   ])
 ])
 
   ])
 ])
 
@@ -55,9 +55,9 @@ AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
   :
   AC_FOREACH([gl_DECL_NAME], [$1], [
 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
   :
   AC_FOREACH([gl_DECL_NAME], [$1], [
-    AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
-      AC_CHECK_DECLS(defn([gl_DECL_NAME]))
+    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
+      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
     ])
     ])
-    AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
+    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
   ])
 ])
   ])
 ])
index 025911fef3af54cafb35e730f041b23e6087c169..14ce1b6198493ebe8821e0ca1f2e29bf6ef10f71 100644 (file)
@@ -1,5 +1,5 @@
-# quote.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# quote.m4 serial 2
+dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
 dnl Public License, this file may be distributed as part of a program
@@ -9,5 +9,5 @@ dnl the same distribution terms as the rest of that program.
 AC_DEFUN([gl_QUOTE],
 [
   dnl Prerequisites of lib/quote.c.
 AC_DEFUN([gl_QUOTE],
 [
   dnl Prerequisites of lib/quote.c.
-  AC_CHECK_HEADERS_ONCE(stddef.h)
+  dnl (none)
 ])
 ])