Browse Source

Remove more of unused bison srcs
ec341d5b3591dde87f6f7c171e12aa7f45a2da12

thegeorg 9 months ago
parent
commit
e728ca9a8c

+ 0 - 1
build/sysincl/misc-win.yml

@@ -89,7 +89,6 @@
   - sched.h:       contrib/tools/bison/lib/platform/win64/sched.h
   - signal.h:      contrib/tools/bison/lib/platform/win64/signal.h
   - spawn.h:       contrib/tools/bison/lib/platform/win64/spawn.h
-  - stdbool.h:     contrib/tools/bison/lib/platform/win64/stdbool.h
   - sys/stat.h:    contrib/tools/bison/lib/platform/win64/sys/stat.h
   - sys/time.h:    contrib/tools/bison/lib/platform/win64/sys/time.h
   - sys/wait.h:    contrib/tools/bison/lib/platform/win64/sys/wait.h

+ 0 - 110
contrib/tools/bison/lib/fopen.c

@@ -1,110 +0,0 @@
-/* Open a stream to a file.
-   Copyright (C) 2007-2013 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 <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
-
-/* If the user's config.h happens to include <stdio.h>, let it include only
-   the system's <stdio.h> here, so that orig_fopen doesn't recurse to
-   rpl_fopen.  */
-#define __need_FILE
-#include <config.h>
-
-/* Get the original definition of fopen.  It might be defined as a macro.  */
-#include <stdio.h>
-#undef __need_FILE
-
-static FILE *
-orig_fopen (const char *filename, const char *mode)
-{
-  return fopen (filename, mode);
-}
-
-/* Specification.  */
-/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates
-   this include because of the preliminary #include <stdio.h> above.  */
-#include "stdio.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-FILE *
-rpl_fopen (const char *filename, const char *mode)
-{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-  if (strcmp (filename, "/dev/null") == 0)
-    filename = "NUL";
-#endif
-
-#if FOPEN_TRAILING_SLASH_BUG
-  /* If the filename ends in a slash and a mode that requires write access is
-     specified, then fail.
-     Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
-     says that
-       "A pathname that contains at least one non-slash character and that
-        ends with one or more trailing slashes shall be resolved as if a
-        single dot character ( '.' ) were appended to the pathname."
-     and
-       "The special filename dot shall refer to the directory specified by
-        its predecessor."
-     If the named file already exists as a directory, then if a mode that
-     requires write access is specified, fopen() must fail because POSIX
-     <http://www.opengroup.org/susv3/functions/fopen.html> says that it
-     fails with errno = EISDIR in this case.
-     If the named file does not exist or does not name a directory, then
-     fopen() must fail since the file does not contain a '.' directory.  */
-  {
-    size_t len = strlen (filename);
-    if (len > 0 && filename[len - 1] == '/')
-      {
-        int fd;
-        struct stat statbuf;
-        FILE *fp;
-
-        if (mode[0] == 'w' || mode[0] == 'a')
-          {
-            errno = EISDIR;
-            return NULL;
-          }
-
-        fd = open (filename, O_RDONLY);
-        if (fd < 0)
-          return NULL;
-
-        if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
-          {
-            close (fd);
-            errno = ENOTDIR;
-            return NULL;
-          }
-
-        fp = fdopen (fd, mode);
-        if (fp == NULL)
-          {
-            int saved_errno = errno;
-            close (fd);
-            errno = saved_errno;
-          }
-        return fp;
-      }
-  }
-# endif
-
-  return orig_fopen (filename, mode);
-}

+ 0 - 162
contrib/tools/bison/lib/fseeko.c

@@ -1,162 +0,0 @@
-/* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007-2013 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, 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 <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-/* Get off_t, lseek, _POSIX_VERSION.  */
-#include <unistd.h>
-
-#include "stdio-impl.h"
-
-int
-fseeko (FILE *fp, off_t offset, int whence)
-#undef fseeko
-#if !HAVE_FSEEKO
-# undef fseek
-# define fseeko fseek
-#endif
-#if _GL_WINDOWS_64_BIT_OFF_T
-# undef fseeko
-# if HAVE__FSEEKI64 /* msvc, mingw64 */
-#  define fseeko _fseeki64
-# else /* mingw */
-#  define fseeko fseeko64
-# endif
-#endif
-{
-#if LSEEK_PIPE_BROKEN
-  /* mingw gives bogus answers rather than failure on non-seekable files.  */
-  if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
-    return EOF;
-#endif
-
-  /* These tests are based on fpurge.c.  */
-#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-  if (fp->_IO_read_end == fp->_IO_read_ptr
-      && fp->_IO_write_ptr == fp->_IO_write_base
-      && fp->_IO_save_base == NULL)
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
-# if defined __SL64 && defined __SCLE /* Cygwin */
-  if ((fp->_flags & __SL64) == 0)
-    {
-      /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
-         mode; but has an fseeko that requires 64-bit mode.  */
-      FILE *tmp = fopen ("/dev/null", "r");
-      if (!tmp)
-        return -1;
-      fp->_flags |= __SL64;
-      fp->_seek64 = tmp->_seek64;
-      fclose (tmp);
-    }
-# endif
-  if (fp_->_p == fp_->_bf._base
-      && fp_->_r == 0
-      && fp_->_w == ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
-                     ? fp_->_bf._size
-                     : 0)
-      && fp_ub._base == NULL)
-#elif defined __EMX__               /* emx+gcc */
-  if (fp->_ptr == fp->_buffer
-      && fp->_rcount == 0
-      && fp->_wcount == 0
-      && fp->_ungetc_count == 0)
-#elif defined __minix               /* Minix */
-  if (fp_->_ptr == fp_->_buf
-      && (fp_->_ptr == NULL || fp_->_count == 0))
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
-  if (fp_->_ptr == fp_->_base
-      && (fp_->_ptr == NULL || fp_->_cnt == 0))
-#elif WIN_SDK10
-  if (((TWinSdk10File*)fp)->_ptr == ((TWinSdk10File*)fp)->_base
-      && (((TWinSdk10File*)fp)->_ptr == NULL || ((TWinSdk10File*)fp)->_cnt == 0))
-#elif defined __UCLIBC__            /* uClibc */
-  if (((fp->__modeflags & __FLAG_WRITING) == 0
-       || fp->__bufpos == fp->__bufstart)
-      && ((fp->__modeflags & (__FLAG_READONLY | __FLAG_READING)) == 0
-          || fp->__bufpos == fp->__bufread))
-#elif defined __QNX__               /* QNX */
-  if ((fp->_Mode & 0x2000 /* _MWRITE */ ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
-      && fp->_Rback == fp->_Back + sizeof (fp->_Back)
-      && fp->_Rsave == NULL)
-#elif defined __MINT__              /* Atari FreeMiNT */
-  if (fp->__bufp == fp->__buffer
-      && fp->__get_limit == fp->__bufp
-      && fp->__put_limit == fp->__bufp
-      && !fp->__pushed_back)
-#elif defined EPLAN9                /* Plan9 */
-  if (fp->rp == fp->buf
-      && fp->wp == fp->buf)
-#elif FUNC_FFLUSH_STDIN < 0 && 200809 <= _POSIX_VERSION
-  /* Cross-compiling to some other system advertising conformance to
-     POSIX.1-2008 or later.  Assume fseeko and fflush work as advertised.
-     If this assumption is incorrect, please report the bug to
-     bug-gnulib.  */
-  if (0)
-#else
-  #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
-#endif
-    {
-      /* We get here when an fflush() call immediately preceded this one (or
-         if ftell() has created buffers but no I/O has occurred on a
-         newly-opened stream).  We know there are no buffers.  */
-      off_t pos = lseek (fileno (fp), offset, whence);
-      if (pos == -1)
-        {
-#if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
-          fp_->_flags &= ~__SOFF;
-#endif
-          return -1;
-        }
-
-#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
-      fp->_flags &= ~_IO_EOF_SEEN;
-      fp->_offset = pos;
-#elif defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
-# if defined __CYGWIN__
-      /* fp_->_offset is typed as an integer.  */
-      fp_->_offset = pos;
-# else
-      /* fp_->_offset is an fpos_t.  */
-      {
-        /* Use a union, since on NetBSD, the compilation flags
-           determine whether fpos_t is typedef'd to off_t or a struct
-           containing a single off_t member.  */
-        union
-          {
-            fpos_t f;
-            off_t o;
-          } u;
-        u.o = pos;
-        fp_->_offset = u.f;
-      }
-# endif
-      fp_->_flags |= __SOFF;
-      fp_->_flags &= ~__SEOF;
-#elif defined __EMX__               /* emx+gcc */
-      fp->_flags &= ~_IOEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, NonStop Kernel */
-      fp->_flag &= ~_IOEOF;
-#elif defined __MINT__              /* Atari FreeMiNT */
-      fp->__offset = pos;
-      fp->__eof = 0;
-#endif
-      return 0;
-    }
-  return fseeko (fp, offset, whence);
-}

+ 0 - 85
contrib/tools/bison/lib/ftello.c

@@ -1,85 +0,0 @@
-/* An ftello() function that works around platform bugs.
-   Copyright (C) 2007, 2009-2013 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 <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <stdio.h>
-
-/* Get lseek.  */
-#include <unistd.h>
-
-#include "stdio-impl.h"
-
-off_t
-ftello (FILE *fp)
-#undef ftello
-#if !HAVE_FTELLO
-# undef ftell
-# define ftello ftell
-#endif
-#if _GL_WINDOWS_64_BIT_OFF_T
-# undef ftello
-# if HAVE__FTELLI64 /* msvc, mingw64 */
-#  define ftello _ftelli64
-# else /* mingw */
-#  define ftello ftello64
-# endif
-#endif
-{
-#if LSEEK_PIPE_BROKEN
-  /* mingw gives bogus answers rather than failure on non-seekable files.  */
-  if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
-    return -1;
-#endif
-
-#if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
-  /* The Solaris stdio leaves the _IOREAD flag set after reading from a file
-     reaches EOF and the program then starts writing to the file.  ftello
-     gets confused by this.  */
-  if (fp_->_flag & _IOWRT)
-    {
-      off_t pos;
-
-      /* Call ftello nevertheless, for the side effects that it does on fp.  */
-      ftello (fp);
-
-      /* Compute the file position ourselves.  */
-      pos = lseek (fileno (fp), (off_t) 0, SEEK_CUR);
-      if (pos >= 0)
-        {
-          if ((fp_->_flag & _IONBF) == 0 && fp_->_base != NULL)
-            pos += fp_->_ptr - fp_->_base;
-        }
-      return pos;
-    }
-#endif
-
-#if defined __SL64 && defined __SCLE /* Cygwin */
-  if ((fp->_flags & __SL64) == 0)
-    {
-      /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
-         mode; but has an ftello that requires 64-bit mode.  */
-      FILE *tmp = fopen ("/dev/null", "r");
-      if (!tmp)
-        return -1;
-      fp->_flags |= __SL64;
-      fp->_seek64 = tmp->_seek64;
-      fclose (tmp);
-    }
-#endif
-  return ftello (fp);
-}

+ 0 - 56
contrib/tools/bison/lib/malloc.c

@@ -1,56 +0,0 @@
-/* malloc() function that is glibc compatible.
-
-   Copyright (C) 1997-1998, 2006-2007, 2009-2013 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, 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 <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering and Bruno Haible */
-
-#define _GL_USE_STDLIB_ALLOC 1
-#include <config.h>
-/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
-#ifdef malloc
-# define NEED_MALLOC_GNU 1
-# undef malloc
-/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
-#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
-# define NEED_MALLOC_GNU 1
-#endif
-
-#include <stdlib.h>
-
-#include <errno.h>
-
-/* Allocate an N-byte block of memory from the heap.
-   If N is zero, allocate a 1-byte block.  */
-
-void *
-rpl_malloc (size_t n)
-{
-  void *result;
-
-#if NEED_MALLOC_GNU
-  if (n == 0)
-    n = 1;
-#endif
-
-  result = malloc (n);
-
-#if !HAVE_MALLOC_POSIX
-  if (result == NULL)
-    errno = ENOMEM;
-#endif
-
-  return result;
-}

+ 0 - 149
contrib/tools/bison/lib/malloca.c

@@ -1,149 +0,0 @@
-/* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2013 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2003.
-
-   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, 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 <http://www.gnu.org/licenses/>.  */
-
-#define _GL_USE_STDLIB_ALLOC 1
-#include <config.h>
-
-/* Specification.  */
-#include "malloca.h"
-
-#include <stdint.h>
-
-#include "verify.h"
-
-/* The speed critical point in this file is freea() applied to an alloca()
-   result: it must be fast, to match the speed of alloca().  The speed of
-   mmalloca() and freea() in the other case are not critical, because they
-   are only invoked for big memory sizes.  */
-
-#if HAVE_ALLOCA
-
-/* Store the mmalloca() results in a hash table.  This is needed to reliably
-   distinguish a mmalloca() result and an alloca() result.
-
-   Although it is possible that the same pointer is returned by alloca() and
-   by mmalloca() at different times in the same application, it does not lead
-   to a bug in freea(), because:
-     - Before a pointer returned by alloca() can point into malloc()ed memory,
-       the function must return, and once this has happened the programmer must
-       not call freea() on it anyway.
-     - Before a pointer returned by mmalloca() can point into the stack, it
-       must be freed.  The only function that can free it is freea(), and
-       when freea() frees it, it also removes it from the hash table.  */
-
-#define MAGIC_NUMBER 0x1415fb4a
-#define MAGIC_SIZE sizeof (int)
-/* This is how the header info would look like without any alignment
-   considerations.  */
-struct preliminary_header { void *next; int magic; };
-/* But the header's size must be a multiple of sa_alignment_max.  */
-#define HEADER_SIZE \
-  (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
-union header {
-  void *next;
-  struct {
-    char room[HEADER_SIZE - MAGIC_SIZE];
-    int word;
-  } magic;
-};
-verify (HEADER_SIZE == sizeof (union header));
-/* We make the hash table quite big, so that during lookups the probability
-   of empty hash buckets is quite high.  There is no need to make the hash
-   table resizable, because when the hash table gets filled so much that the
-   lookup becomes slow, it means that the application has memory leaks.  */
-#define HASH_TABLE_SIZE 257
-static void * mmalloca_results[HASH_TABLE_SIZE];
-
-#endif
-
-void *
-mmalloca (size_t n)
-{
-#if HAVE_ALLOCA
-  /* Allocate one more word, that serves as an indicator for malloc()ed
-     memory, so that freea() of an alloca() result is fast.  */
-  size_t nplus = n + HEADER_SIZE;
-
-  if (nplus >= n)
-    {
-      void *p = malloc (nplus);
-
-      if (p != NULL)
-        {
-          size_t slot;
-          union header *h = p;
-
-          p = h + 1;
-
-          /* Put a magic number into the indicator word.  */
-          h->magic.word = MAGIC_NUMBER;
-
-          /* Enter p into the hash table.  */
-          slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          h->next = mmalloca_results[slot];
-          mmalloca_results[slot] = p;
-
-          return p;
-        }
-    }
-  /* Out of memory.  */
-  return NULL;
-#else
-# if !MALLOC_0_IS_NONNULL
-  if (n == 0)
-    n = 1;
-# endif
-  return malloc (n);
-#endif
-}
-
-#if HAVE_ALLOCA
-void
-freea (void *p)
-{
-  /* mmalloca() may have returned NULL.  */
-  if (p != NULL)
-    {
-      /* Attempt to quickly distinguish the mmalloca() result - which has
-         a magic indicator word - and the alloca() result - which has an
-         uninitialized indicator word.  It is for this test that sa_increment
-         additional bytes are allocated in the alloca() case.  */
-      if (((int *) p)[-1] == MAGIC_NUMBER)
-        {
-          /* Looks like a mmalloca() result.  To see whether it really is one,
-             perform a lookup in the hash table.  */
-          size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          void **chain = &mmalloca_results[slot];
-          for (; *chain != NULL;)
-            {
-              union header *h = p;
-              if (*chain == p)
-                {
-                  /* Found it.  Remove it from the hash table and free it.  */
-                  union header *p_begin = h - 1;
-                  *chain = p_begin->next;
-                  free (p_begin);
-                  return;
-                }
-              h = *chain;
-              chain = &h[-1].next;
-            }
-        }
-      /* At this point, we know it was not a mmalloca() result.  */
-    }
-}
-#endif

+ 0 - 133
contrib/tools/bison/lib/malloca.h

@@ -1,133 +0,0 @@
-/* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2013 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2003.
-
-   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, 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 <http://www.gnu.org/licenses/>.  */
-
-#ifndef _MALLOCA_H
-#define _MALLOCA_H
-
-#include <alloca.h>
-#include <stddef.h>
-#include <stdlib.h>
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
-   alloca(N); otherwise it returns NULL.  It either returns N bytes of
-   memory allocated on the stack, that lasts until the function returns,
-   or NULL.
-   Use of safe_alloca should be avoided:
-     - inside arguments of function calls - undefined behaviour,
-     - in inline functions - the allocation may actually last until the
-       calling function returns.
-*/
-#if HAVE_ALLOCA
-/* The OS usually guarantees only one guard page at the bottom of the stack,
-   and a page size can be as small as 4096 bytes.  So we cannot safely
-   allocate anything larger than 4096 bytes.  Also care for the possibility
-   of a few compiler-allocated temporary stack slots.
-   This must be a macro, not a function.  */
-# define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL)
-#else
-# define safe_alloca(N) ((void) (N), NULL)
-#endif
-
-/* malloca(N) is a safe variant of alloca(N).  It allocates N bytes of
-   memory allocated on the stack, that must be freed using freea() before
-   the function returns.  Upon failure, it returns NULL.  */
-#if HAVE_ALLOCA
-# define malloca(N) \
-  ((N) < 4032 - sa_increment                                        \
-   ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
-   : mmalloca (N))
-#else
-# define malloca(N) \
-  mmalloca (N)
-#endif
-extern void * mmalloca (size_t n);
-
-/* Free a block of memory allocated through malloca().  */
-#if HAVE_ALLOCA
-extern void freea (void *p);
-#else
-# define freea free
-#endif
-
-/* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
-   It allocates an array of N objects, each with S bytes of memory,
-   on the stack.  S must be positive and N must be nonnegative.
-   The array must be freed using freea() before the function returns.  */
-#if 1
-/* Cf. the definition of xalloc_oversized.  */
-# define nmalloca(n, s) \
-    ((n) > (size_t) (sizeof (ptrdiff_t) <= sizeof (size_t) ? -1 : -2) / (s) \
-     ? NULL \
-     : malloca ((n) * (s)))
-#else
-extern void * nmalloca (size_t n, size_t s);
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-
-/* ------------------- Auxiliary, non-public definitions ------------------- */
-
-/* Determine the alignment of a type at compile time.  */
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
-# define sa_alignof __alignof__
-#elif defined __cplusplus
-  template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
-# define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
-#elif defined __hpux
-  /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
-     values.  */
-# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
-#elif defined _AIX
-  /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
-     values.  */
-# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8)
-#else
-# define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
-#endif
-
-enum
-{
-/* The desired alignment of memory allocations is the maximum alignment
-   among all elementary types.  */
-  sa_alignment_long = sa_alignof (long),
-  sa_alignment_double = sa_alignof (double),
-#if HAVE_LONG_LONG_INT
-  sa_alignment_longlong = sa_alignof (long long),
-#endif
-  sa_alignment_longdouble = sa_alignof (long double),
-  sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
-#if HAVE_LONG_LONG_INT
-                      | (sa_alignment_longlong - 1)
-#endif
-                      | (sa_alignment_longdouble - 1)
-                     ) + 1,
-/* The increment that guarantees room for a magic word must be >= sizeof (int)
-   and a multiple of sa_alignment_max.  */
-  sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max
-};
-
-#endif /* _MALLOCA_H */

+ 0 - 402
contrib/tools/bison/lib/mbrtowc.c

@@ -1,402 +0,0 @@
-/* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2013 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2008.
-
-   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 <http://www.gnu.org/licenses/>.  */
-
-#include <config.h>
-
-/* Specification.  */
-#include <wchar.h>
-
-#if GNULIB_defined_mbstate_t
-/* Implement mbrtowc() on top of mbtowc().  */
-
-# include <errno.h>
-# include <stdlib.h>
-
-# include "localcharset.h"
-# include "streq.h"
-# include "verify.h"
-
-
-verify (sizeof (mbstate_t) >= 4);
-
-static char internal_state[4];
-
-size_t
-mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
-{
-  char *pstate = (char *)ps;
-
-  if (s == NULL)
-    {
-      pwc = NULL;
-      s = "";
-      n = 1;
-    }
-
-  if (n == 0)
-    return (size_t)(-2);
-
-  /* Here n > 0.  */
-
-  if (pstate == NULL)
-    pstate = internal_state;
-
-  {
-    size_t nstate = pstate[0];
-    char buf[4];
-    const char *p;
-    size_t m;
-
-    switch (nstate)
-      {
-      case 0:
-        p = s;
-        m = n;
-        break;
-      case 3:
-        buf[2] = pstate[3];
-        /*FALLTHROUGH*/
-      case 2:
-        buf[1] = pstate[2];
-        /*FALLTHROUGH*/
-      case 1:
-        buf[0] = pstate[1];
-        p = buf;
-        m = nstate;
-        buf[m++] = s[0];
-        if (n >= 2 && m < 4)
-          {
-            buf[m++] = s[1];
-            if (n >= 3 && m < 4)
-              buf[m++] = s[2];
-          }
-        break;
-      default:
-        errno = EINVAL;
-        return (size_t)(-1);
-      }
-
-    /* Here m > 0.  */
-
-# if __GLIBC__ || defined __UCLIBC__
-    /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
-    mbtowc (NULL, NULL, 0);
-# endif
-    {
-      int res = mbtowc (pwc, p, m);
-
-      if (res >= 0)
-        {
-          if (pwc != NULL && ((*pwc == 0) != (res == 0)))
-            abort ();
-          if (nstate >= (res > 0 ? res : 1))
-            abort ();
-          res -= nstate;
-          pstate[0] = 0;
-          return res;
-        }
-
-      /* mbtowc does not distinguish between invalid and incomplete multibyte
-         sequences.  But mbrtowc needs to make this distinction.
-         There are two possible approaches:
-           - Use iconv() and its return value.
-           - Use built-in knowledge about the possible encodings.
-         Given the low quality of implementation of iconv() on the systems that
-         lack mbrtowc(), we use the second approach.
-         The possible encodings are:
-           - 8-bit encodings,
-           - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
-           - UTF-8.
-         Use specialized code for each.  */
-      if (m >= 4 || m >= MB_CUR_MAX)
-        goto invalid;
-      /* Here MB_CUR_MAX > 1 and 0 < m < 4.  */
-      {
-        const char *encoding = locale_charset ();
-
-        if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
-          {
-            /* Cf. unistr/u8-mblen.c.  */
-            unsigned char c = (unsigned char) p[0];
-
-            if (c >= 0xc2)
-              {
-                if (c < 0xe0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                  }
-                else if (c < 0xf0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    if (m == 2)
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xe1 || c2 >= 0xa0)
-                            && (c != 0xed || c2 < 0xa0))
-                          goto incomplete;
-                      }
-                  }
-                else if (c <= 0xf4)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    else /* m == 2 || m == 3 */
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xf1 || c2 >= 0x90)
-                            && (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
-                          {
-                            if (m == 2)
-                              goto incomplete;
-                            else /* m == 3 */
-                              {
-                                unsigned char c3 = (unsigned char) p[2];
-
-                                if ((c3 ^ 0x80) < 0x40)
-                                  goto incomplete;
-                              }
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-
-        /* As a reference for this code, you can use the GNU libiconv
-           implementation.  Look for uses of the RET_TOOFEW macro.  */
-
-        if (STREQ_OPT (encoding,
-                       "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
-                  goto incomplete;
-              }
-            if (m == 2)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8f)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0xa1 && c2 < 0xff)
-                      goto incomplete;
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-            || STREQ_OPT (encoding,
-                          "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-            || STREQ_OPT (encoding,
-                          "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0xa1 && c < 0xff)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8e)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0x90 && c <= 0xe3)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0x30 && c2 <= 0x39)
-                      {
-                        if (m == 2)
-                          goto incomplete;
-                        else /* m == 3 */
-                          {
-                            unsigned char c3 = (unsigned char) p[2];
-
-                            if (c3 >= 0x81 && c3 <= 0xfe)
-                              goto incomplete;
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
-                    || (c >= 0xf0 && c <= 0xf9))
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-
-        /* An unknown multibyte encoding.  */
-        goto incomplete;
-      }
-
-     incomplete:
-      {
-        size_t k = nstate;
-        /* Here 0 <= k < m < 4.  */
-        pstate[++k] = s[0];
-        if (k < m)
-          {
-            pstate[++k] = s[1];
-            if (k < m)
-              pstate[++k] = s[2];
-          }
-        if (k != m)
-          abort ();
-      }
-      pstate[0] = m;
-      return (size_t)(-2);
-
-     invalid:
-      errno = EILSEQ;
-      /* The conversion state is undefined, says POSIX.  */
-      return (size_t)(-1);
-    }
-  }
-}
-
-#else
-/* Override the system's mbrtowc() function.  */
-
-# undef mbrtowc
-
-size_t
-rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
-{
-# if MBRTOWC_NULL_ARG2_BUG || MBRTOWC_RETVAL_BUG
-  if (s == NULL)
-    {
-      pwc = NULL;
-      s = "";
-      n = 1;
-    }
-# endif
-
-# if MBRTOWC_RETVAL_BUG
-  {
-    static mbstate_t internal_state;
-
-    /* Override mbrtowc's internal state.  We cannot call mbsinit() on the
-       hidden internal state, but we can call it on our variable.  */
-    if (ps == NULL)
-      ps = &internal_state;
-
-    if (!mbsinit (ps))
-      {
-        /* Parse the rest of the multibyte character byte for byte.  */
-        size_t count = 0;
-        for (; n > 0; s++, n--)
-          {
-            wchar_t wc;
-            size_t ret = mbrtowc (&wc, s, 1, ps);
-
-            if (ret == (size_t)(-1))
-              return (size_t)(-1);
-            count++;
-            if (ret != (size_t)(-2))
-              {
-                /* The multibyte character has been completed.  */
-                if (pwc != NULL)
-                  *pwc = wc;
-                return (wc == 0 ? 0 : count);
-              }
-          }
-        return (size_t)(-2);
-      }
-  }
-# endif
-
-# if MBRTOWC_NUL_RETVAL_BUG
-  {
-    wchar_t wc;
-    size_t ret = mbrtowc (&wc, s, n, ps);
-
-    if (ret != (size_t)(-1) && ret != (size_t)(-2))
-      {
-        if (pwc != NULL)
-          *pwc = wc;
-        if (wc == 0)
-          ret = 0;
-      }
-    return ret;
-  }
-# else
-  {
-#   if MBRTOWC_NULL_ARG1_BUG
-    wchar_t dummy;
-
-    if (pwc == NULL)
-      pwc = &dummy;
-#   endif
-
-    return mbrtowc (pwc, s, n, ps);
-  }
-# endif
-}
-
-#endif

+ 1 - 1
contrib/tools/bison/lib/platform/win64/config.h

@@ -967,7 +967,7 @@
 char *strsignal (int signum);
 
 /* Define to 1 if `decimal_point' is a member of `struct lconv'. */
-#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
+/* #undef HAVE_STRUCT_LCONV_DECIMAL_POINT */
 
 /* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
 /* #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION */

+ 0 - 133
contrib/tools/bison/lib/platform/win64/stdbool.h

@@ -1,133 +0,0 @@
-/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-/* Copyright (C) 2001-2003, 2006-2013 Free Software Foundation, Inc.
-   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
-
-   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, 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 <http://www.gnu.org/licenses/>.  */
-
-#ifndef _GL_STDBOOL_H
-#define _GL_STDBOOL_H
-
-/* ISO C 99 <stdbool.h> for platforms that lack it.  */
-
-/* Usage suggestions:
-
-   Programs that use <stdbool.h> should be aware of some limitations
-   and standards compliance issues.
-
-   Standards compliance:
-
-       - <stdbool.h> must be #included before 'bool', 'false', 'true'
-         can be used.
-
-       - You cannot assume that sizeof (bool) == 1.
-
-       - Programs should not undefine the macros bool, true, and false,
-         as C99 lists that as an "obsolescent feature".
-
-   Limitations of this substitute, when used in a C89 environment:
-
-       - <stdbool.h> must be #included before the '_Bool' type can be used.
-
-       - You cannot assume that _Bool is a typedef; it might be a macro.
-
-       - Bit-fields of type 'bool' are not supported.  Portable code
-         should use 'unsigned int foo : 1;' rather than 'bool foo : 1;'.
-
-       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
-         performed in such a way that every nonzero value gets converted
-         to 'true', and zero gets converted to 'false'.  This doesn't work
-         with this substitute.  With this substitute, only the values 0 and 1
-         give the expected result when converted to _Bool' or 'bool'.
-
-       - C99 allows the use of (_Bool)0.0 in constant expressions, but
-         this substitute cannot always provide this property.
-
-   Also, it is suggested that programs use 'bool' rather than '_Bool';
-   this isn't required, but 'bool' is more common.  */
-
-
-/* 7.16. Boolean type and values */
-
-/* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
-   definitions below, but temporarily we have to #undef them.  */
-#if defined __BEOS__ && !defined __HAIKU__
-# error #include <OS.h> /* defines bool but not _Bool */
-# undef false
-# undef true
-#endif
-
-#ifdef __cplusplus
-# define _Bool bool
-# define bool bool
-#else
-# if defined __BEOS__ && !defined __HAIKU__
-  /* A compiler known to have 'bool'.  */
-  /* If the compiler already has both 'bool' and '_Bool', we can assume they
-     are the same types.  */
-#  if !0
-typedef bool _Bool;
-#  endif
-# else
-#  if !defined __GNUC__
-   /* If 0:
-        Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
-        the built-in _Bool type is used.  See
-          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
-        Similar bugs are likely with other compilers as well; this file
-        wouldn't be used if <stdbool.h> was working.
-        So we override the _Bool type.
-      If !0:
-        Need to define _Bool ourselves. As 'signed char' or as an enum type?
-        Use of a typedef, with SunPRO C, leads to a stupid
-          "warning: _Bool is a keyword in ISO C99".
-        Use of an enum type, with IRIX cc, leads to a stupid
-          "warning(1185): enumerated type mixed with another type".
-        Even the existence of an enum type, without a typedef,
-          "Invalid enumerator. (badenum)" with HP-UX cc on Tru64.
-        The only benefit of the enum, debuggability, is not important
-        with these compilers.  So use 'signed char' and no enum.  */
-#   define _Bool signed char
-#  else
-   /* With this compiler, trust the _Bool type if the compiler has it.  */
-#   if !0
-   /* For the sake of symbolic names in gdb, define true and false as
-      enum constants, not only as macros.
-      It is tempting to write
-         typedef enum { false = 0, true = 1 } _Bool;
-      so that gdb prints values of type 'bool' symbolically.  But then
-      values of type '_Bool' might promote to 'int' or 'unsigned int'
-      (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
-      (see ISO C 99 6.3.1.1.(2)).  So add a negative value to the
-      enum; this ensures that '_Bool' promotes to 'int'.  */
-typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
-#   endif
-#  endif
-# endif
-# define bool _Bool
-#endif
-
-/* The other macros must be usable in preprocessor directives.  */
-#ifdef __cplusplus
-# define false false
-# define true true
-#else
-# define false 0
-# define true 1
-#endif
-
-#define __bool_true_false_are_defined 1
-
-#endif /* _GL_STDBOOL_H */

Some files were not shown because too many files changed in this diff