aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/bison
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2024-06-21 11:28:24 +0300
committerthegeorg <thegeorg@yandex-team.com>2024-06-21 11:52:22 +0300
commit8fd47d685a4b91a0476ad64ee6d956078904b33f (patch)
treef677a61df45cc4e68814fcbda738c2dbdd6474ca /contrib/tools/bison
parent424c5c935fddd2da90f5c6760011ae0e681f9d56 (diff)
downloadydb-8fd47d685a4b91a0476ad64ee6d956078904b33f.tar.gz
Put contrib/tools/bison under yamaker
fc8958be3a17b5e88f21aad92b3ed2b1630d4ad8
Diffstat (limited to 'contrib/tools/bison')
-rw-r--r--contrib/tools/bison/README-release100
-rw-r--r--contrib/tools/bison/lib/asnprintf.c34
-rw-r--r--contrib/tools/bison/lib/config-linux.h1690
-rw-r--r--contrib/tools/bison/lib/config-osx.h30
-rw-r--r--contrib/tools/bison/lib/config-win.h1
-rw-r--r--contrib/tools/bison/lib/configmake-linux.h27
-rw-r--r--contrib/tools/bison/lib/configmake.h8
-rw-r--r--contrib/tools/bison/lib/error.c2
-rw-r--r--contrib/tools/bison/lib/glthread/lock.c1057
-rw-r--r--contrib/tools/bison/lib/glthread/lock.h927
-rw-r--r--contrib/tools/bison/lib/glthread/threadlib.c73
-rw-r--r--contrib/tools/bison/lib/isnanf.c20
-rw-r--r--contrib/tools/bison/lib/isnanl-nolibm.h2
-rw-r--r--contrib/tools/bison/lib/math.c3
-rw-r--r--contrib/tools/bison/lib/ya.make88
-rw-r--r--contrib/tools/bison/src/getargs.c2
-rw-r--r--contrib/tools/bison/src/getargs.h1
-rw-r--r--contrib/tools/bison/src/main.c5
-rw-r--r--contrib/tools/bison/src/output.c6
-rw-r--r--contrib/tools/bison/ya.make40
20 files changed, 3399 insertions, 717 deletions
diff --git a/contrib/tools/bison/README-release b/contrib/tools/bison/README-release
new file mode 100644
index 0000000000..4d9423a9d9
--- /dev/null
+++ b/contrib/tools/bison/README-release
@@ -0,0 +1,100 @@
+Here are most of the steps we (maintainers) follow when making a release.
+
+* Start from a clean, up-to-date git directory on "master":
+
+ make -k maintainer-clean || { ./configure && make maintainer-clean; }
+ git checkout master
+ git pull origin master
+
+* Ensure that the latest stable versions of autoconf, automake, etc.
+ are in your PATH. See the buildreq list in bootstrap.conf for
+ the complete list of tools.
+
+* Ensure that you have no uncommitted diffs. This should produce no
+ output:
+
+ git diff
+
+* Ensure that you've pushed all changes that belong in the release:
+
+ git push origin master
+
+* Check that the NixOS/Hydra autobuilder is reporting all is well:
+
+ http://hydra.nixos.org/jobset/gnu/bison-master
+
+* Run the following command to download any new translations:
+
+ ./bootstrap && ./configure
+
+* Pre-release testing: ensure that the following command succeeds:
+
+ make check syntax-check distcheck
+
+* To (i) set the date, version number, and release TYPE on line 3 of
+ NEWS, (ii) commit that, and (iii) tag the release, run
+
+ # "TYPE" must be stable, beta or alpha
+ make release-commit RELEASE='X.Y TYPE'
+
+* Run the following to create release tarballs. Your choice selects the
+ corresponding upload-to destination in the emitted gnupload command.
+ The different destinations are specified in cfg.mk. See the definitions
+ of gnu_ftp_host-{alpha,beta,stable}.
+
+ make release RELEASE='X.Y TYPE'
+
+* Test the tarball. Copy it to a few odd-ball systems and ensure that
+ it builds and passes all tests.
+
+* While that's happening, write the release announcement that you will
+ soon post. Start with the template, $HOME/announce-bison-X.Y
+ that was just created by that "make" command.
+
+Once all the builds and tests have passed,
+
+* Run the gnupload command that was suggested by your "make release"
+ run above, or run
+
+ make upload RELEASE='X.Y TYPE'
+
+* Wait a few minutes (maybe up to 30?) and then use the release URLs to
+ download all tarball/signature pairs and use gpg --verify to ensure
+ that they're all valid.
+
+* Push the NEWS-updating changes and the new tag:
+
+ v=$(cat .prev-version)
+ git push origin master tag v$v
+
+* Announce it on Savannah first, so you can include the savannah.org
+ announcement link in the email message.
+
+ Go to the news-submission form:
+
+ https://savannah.gnu.org/news/submit.php?group=bison
+
+ If it does not work, then enable "News" for the project via this link:
+
+ https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=bison
+
+ Write something like the following:
+
+ Subject: bison-X.Y released [stable]
+ +verbatim+
+ ...paste the announcement here...
+ -verbatim-
+
+ Then go here to approve it:
+
+ https://savannah.gnu.org/news/approve.php?group=bison
+
+* Send the announcement email message.
+
+* After each non-alpha release, run
+
+ make web-manual-update
+
+ to update the on-line manual accessible at
+
+ http://www.gnu.org/software/bison/manual/
diff --git a/contrib/tools/bison/lib/asnprintf.c b/contrib/tools/bison/lib/asnprintf.c
new file mode 100644
index 0000000000..76e228d860
--- /dev/null
+++ b/contrib/tools/bison/lib/asnprintf.c
@@ -0,0 +1,34 @@
+/* Formatted output to strings.
+ Copyright (C) 1999, 2002, 2006, 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/>. */
+
+#include <config.h>
+
+/* Specification. */
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+
+char *
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+ va_list args;
+ char *result;
+
+ va_start (args, format);
+ result = vasnprintf (resultbuf, lengthp, format, args);
+ va_end (args);
+ return result;
+}
diff --git a/contrib/tools/bison/lib/config-linux.h b/contrib/tools/bison/lib/config-linux.h
index 294275396e..72ac3690de 100644
--- a/contrib/tools/bison/lib/config-linux.h
+++ b/contrib/tools/bison/lib/config-linux.h
@@ -1,5 +1,5 @@
-/* lib/config.h. Generated from config.hin by configure. */
-/* lib/config.hin. Generated from configure.ac by autoheader. */
+/* lib/config.h. Generated from config.in.h by configure. */
+/* lib/config.in.h. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
@@ -47,11 +47,9 @@
/* Define to 1 if // is a file system root distinct from /. */
/* #undef DOUBLE_SLASH_IS_DISTINCT_ROOT */
-/* Define to 1 if the changeword(REGEXP) functionality is wanted */
-/* #undef ENABLE_CHANGEWORD */
-
-/* Define to 1 if an invalid memory address access may yield a SIGBUS. */
-#define FAULT_YIELDS_SIGBUS 0
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+/* #undef ENABLE_NLS */
/* Define this to 1 if F_DUPFD behavior does not match POSIX */
/* #undef FCNTL_DUPFD_BUGGY */
@@ -72,41 +70,6 @@
/* Define to 1 if fopen() fails to recognize a trailing slash. */
/* #undef FOPEN_TRAILING_SLASH_BUG */
-/* Enable compile-time and run-time bounds-checking, and some warnings,
- without upsetting newer glibc. */
- #if defined __OPTIMIZE__ && __OPTIMIZE__
- # define _FORTIFY_SOURCE 2
- #endif
-
-
-/* Define to 1 if the system's ftello function has the Solaris bug. */
-/* #undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE */
-
-/* Define to 1 if fflush is known to work on stdin as per POSIX.1-2008, 0 if
- fflush is known to not work, -1 if unknown. */
-#define FUNC_FFLUSH_STDIN 0
-
-/* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */
-#define FUNC_NL_LANGINFO_YESEXPR_WORKS 1
-
-/* Define to 1 if realpath() can malloc memory, always gives an absolute path,
- and handles trailing slash correctly. */
-#define FUNC_REALPATH_WORKS 1
-
-/* Define to 1 if ungetc is broken when used on arbitrary bytes. */
-/* #undef FUNC_UNGETC_BROKEN */
-
-/* Define if gettimeofday clobbers the localtime buffer. */
-/* #undef GETTIMEOFDAY_CLOBBERS_LOCALTIME */
-
-/* Define this to 'void' or 'struct timezone' to match the system's
- declaration of the second argument to gettimeofday. */
-#define GETTIMEOFDAY_TIMEZONE struct timezone
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
- whether the gnulib module canonicalize-lgpl shall be considered present. */
-#define GNULIB_CANONICALIZE_LGPL 1
-
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module close-stream shall be considered present. */
#define GNULIB_CLOSE_STREAM 1
@@ -120,14 +83,6 @@
#define GNULIB_FD_SAFER_FLAG 1
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
- whether the gnulib module fflush shall be considered present. */
-#define GNULIB_FFLUSH 1
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
- whether the gnulib module filenamecat shall be considered present. */
-#define GNULIB_FILENAMECAT 1
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module fopen-safer shall be considered present. */
#define GNULIB_FOPEN_SAFER 1
@@ -152,10 +107,6 @@
#define GNULIB_SCANF 1
/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
- whether the gnulib module sigpipe shall be considered present. */
-#define GNULIB_SIGPIPE 1
-
-/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
whether the gnulib module snprintf shall be considered present. */
#define GNULIB_SNPRINTF 1
@@ -163,15 +114,8 @@
whether the gnulib module strerror shall be considered present. */
#define GNULIB_STRERROR 1
-/* Define to 1 when the gnulib module btowc should be tested. */
-#define GNULIB_TEST_BTOWC 1
-
-/* Define to 1 when the gnulib module canonicalize_file_name should be tested.
- */
-#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1
-
-/* Define to 1 when the gnulib module chdir should be tested. */
-#define GNULIB_TEST_CHDIR 1
+/* Define to 1 when the gnulib module calloc-posix should be tested. */
+#define GNULIB_TEST_CALLOC_POSIX 1
/* Define to 1 when the gnulib module cloexec should be tested. */
#define GNULIB_TEST_CLOEXEC 1
@@ -179,35 +123,20 @@
/* Define to 1 when the gnulib module close should be tested. */
#define GNULIB_TEST_CLOSE 1
-/* Define to 1 when the gnulib module closedir should be tested. */
-#define GNULIB_TEST_CLOSEDIR 1
-
-/* Define to 1 when the gnulib module dup should be tested. */
-#define GNULIB_TEST_DUP 1
-
/* Define to 1 when the gnulib module dup2 should be tested. */
#define GNULIB_TEST_DUP2 1
/* Define to 1 when the gnulib module environ should be tested. */
#define GNULIB_TEST_ENVIRON 1
-/* Define to 1 when the gnulib module fclose should be tested. */
-#define GNULIB_TEST_FCLOSE 1
-
/* Define to 1 when the gnulib module fcntl should be tested. */
#define GNULIB_TEST_FCNTL 1
-/* Define to 1 when the gnulib module fdopen should be tested. */
-#define GNULIB_TEST_FDOPEN 1
-
-/* Define to 1 when the gnulib module fflush should be tested. */
-#define GNULIB_TEST_FFLUSH 1
-
/* Define to 1 when the gnulib module fopen should be tested. */
#define GNULIB_TEST_FOPEN 1
-/* Define to 1 when the gnulib module fpurge should be tested. */
-#define GNULIB_TEST_FPURGE 1
+/* Define to 1 when the gnulib module fprintf-posix should be tested. */
+#define GNULIB_TEST_FPRINTF_POSIX 1
/* Define to 1 when the gnulib module frexp should be tested. */
#define GNULIB_TEST_FREXP 1
@@ -215,47 +144,29 @@
/* Define to 1 when the gnulib module frexpl should be tested. */
#define GNULIB_TEST_FREXPL 1
-/* Define to 1 when the gnulib module fseek should be tested. */
-#define GNULIB_TEST_FSEEK 1
-
-/* Define to 1 when the gnulib module fseeko should be tested. */
-#define GNULIB_TEST_FSEEKO 1
-
/* Define to 1 when the gnulib module fstat should be tested. */
#define GNULIB_TEST_FSTAT 1
-/* Define to 1 when the gnulib module ftell should be tested. */
-#define GNULIB_TEST_FTELL 1
-
-/* Define to 1 when the gnulib module ftello should be tested. */
-#define GNULIB_TEST_FTELLO 1
-
-/* Define to 1 when the gnulib module getcwd should be tested. */
-#define GNULIB_TEST_GETCWD 1
-
/* Define to 1 when the gnulib module getdtablesize should be tested. */
#define GNULIB_TEST_GETDTABLESIZE 1
/* Define to 1 when the gnulib module getopt-gnu should be tested. */
#define GNULIB_TEST_GETOPT_GNU 1
-/* Define to 1 when the gnulib module getpagesize should be tested. */
-#define GNULIB_TEST_GETPAGESIZE 1
-
-/* Define to 1 when the gnulib module gettimeofday should be tested. */
-#define GNULIB_TEST_GETTIMEOFDAY 1
+/* Define to 1 when the gnulib module isnan should be tested. */
+#define GNULIB_TEST_ISNAN 1
-/* Define to 1 when the gnulib module link should be tested. */
-#define GNULIB_TEST_LINK 1
+/* Define to 1 when the gnulib module isnand should be tested. */
+#define GNULIB_TEST_ISNAND 1
-/* Define to 1 when the gnulib module localeconv should be tested. */
-#define GNULIB_TEST_LOCALECONV 1
+/* Define to 1 when the gnulib module isnanf should be tested. */
+#define GNULIB_TEST_ISNANF 1
-/* Define to 1 when the gnulib module lseek should be tested. */
-#define GNULIB_TEST_LSEEK 1
+/* Define to 1 when the gnulib module isnanl should be tested. */
+#define GNULIB_TEST_ISNANL 1
-/* Define to 1 when the gnulib module lstat should be tested. */
-#define GNULIB_TEST_LSTAT 1
+/* Define to 1 when the gnulib module ldexpl should be tested. */
+#define GNULIB_TEST_LDEXPL 1
/* Define to 1 when the gnulib module malloc-posix should be tested. */
#define GNULIB_TEST_MALLOC_POSIX 1
@@ -266,26 +177,17 @@
/* Define to 1 when the gnulib module mbsinit should be tested. */
#define GNULIB_TEST_MBSINIT 1
-/* Define to 1 when the gnulib module mbtowc should be tested. */
-#define GNULIB_TEST_MBTOWC 1
-
/* Define to 1 when the gnulib module memchr should be tested. */
#define GNULIB_TEST_MEMCHR 1
-/* Define to 1 when the gnulib module mkdtemp should be tested. */
-#define GNULIB_TEST_MKDTEMP 1
-
-/* Define to 1 when the gnulib module mkstemp should be tested. */
-#define GNULIB_TEST_MKSTEMP 1
-
-/* Define to 1 when the gnulib module nl_langinfo should be tested. */
-#define GNULIB_TEST_NL_LANGINFO 1
+/* Define to 1 when the gnulib module obstack-printf should be tested. */
+#define GNULIB_TEST_OBSTACK_PRINTF 1
/* Define to 1 when the gnulib module open should be tested. */
#define GNULIB_TEST_OPEN 1
-/* Define to 1 when the gnulib module opendir should be tested. */
-#define GNULIB_TEST_OPENDIR 1
+/* Define to 1 when the gnulib module perror should be tested. */
+#define GNULIB_TEST_PERROR 1
/* Define to 1 when the gnulib module pipe2 should be tested. */
#define GNULIB_TEST_PIPE2 1
@@ -329,8 +231,8 @@
tested. */
#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT 1
-/* Define to 1 when the gnulib module putenv should be tested. */
-#define GNULIB_TEST_PUTENV 1
+/* Define to 1 when the gnulib module printf-posix should be tested. */
+#define GNULIB_TEST_PRINTF_POSIX 1
/* Define to 1 when the gnulib module raise should be tested. */
#define GNULIB_TEST_RAISE 1
@@ -338,29 +240,8 @@
/* Define to 1 when the gnulib module rawmemchr should be tested. */
#define GNULIB_TEST_RAWMEMCHR 1
-/* Define to 1 when the gnulib module readdir should be tested. */
-#define GNULIB_TEST_READDIR 1
-
-/* Define to 1 when the gnulib module readlink should be tested. */
-#define GNULIB_TEST_READLINK 1
-
-/* Define to 1 when the gnulib module realpath should be tested. */
-#define GNULIB_TEST_REALPATH 1
-
-/* Define to 1 when the gnulib module rename should be tested. */
-#define GNULIB_TEST_RENAME 1
-
-/* Define to 1 when the gnulib module rmdir should be tested. */
-#define GNULIB_TEST_RMDIR 1
-
-/* Define to 1 when the gnulib module secure_getenv should be tested. */
-#define GNULIB_TEST_SECURE_GETENV 1
-
-/* Define to 1 when the gnulib module setenv should be tested. */
-#define GNULIB_TEST_SETENV 1
-
-/* Define to 1 when the gnulib module setlocale should be tested. */
-#define GNULIB_TEST_SETLOCALE 1
+/* Define to 1 when the gnulib module realloc-posix should be tested. */
+#define GNULIB_TEST_REALLOC_POSIX 1
/* Define to 1 when the gnulib module sigaction should be tested. */
#define GNULIB_TEST_SIGACTION 1
@@ -371,15 +252,18 @@
/* Define to 1 when the gnulib module sigprocmask should be tested. */
#define GNULIB_TEST_SIGPROCMASK 1
-/* Define to 1 when the gnulib module sleep should be tested. */
-#define GNULIB_TEST_SLEEP 1
-
/* Define to 1 when the gnulib module snprintf should be tested. */
#define GNULIB_TEST_SNPRINTF 1
+/* Define to 1 when the gnulib module sprintf-posix should be tested. */
+#define GNULIB_TEST_SPRINTF_POSIX 1
+
/* Define to 1 when the gnulib module stat should be tested. */
#define GNULIB_TEST_STAT 1
+/* Define to 1 when the gnulib module stpcpy should be tested. */
+#define GNULIB_TEST_STPCPY 1
+
/* Define to 1 when the gnulib module strchrnul should be tested. */
#define GNULIB_TEST_STRCHRNUL 1
@@ -389,44 +273,35 @@
/* Define to 1 when the gnulib module strerror should be tested. */
#define GNULIB_TEST_STRERROR 1
+/* Define to 1 when the gnulib module strerror_r should be tested. */
+#define GNULIB_TEST_STRERROR_R 1
+
/* Define to 1 when the gnulib module strndup should be tested. */
#define GNULIB_TEST_STRNDUP 1
/* Define to 1 when the gnulib module strnlen should be tested. */
#define GNULIB_TEST_STRNLEN 1
-/* Define to 1 when the gnulib module strsignal should be tested. */
-#define GNULIB_TEST_STRSIGNAL 1
-
-/* Define to 1 when the gnulib module strstr should be tested. */
-#define GNULIB_TEST_STRSTR 1
-
-/* Define to 1 when the gnulib module strtod should be tested. */
-#define GNULIB_TEST_STRTOD 1
-
-/* Define to 1 when the gnulib module symlink should be tested. */
-#define GNULIB_TEST_SYMLINK 1
+/* Define to 1 when the gnulib module strverscmp should be tested. */
+#define GNULIB_TEST_STRVERSCMP 1
/* Define to 1 when the gnulib module unsetenv should be tested. */
#define GNULIB_TEST_UNSETENV 1
-/* Define to 1 when the gnulib module vasprintf should be tested. */
-#define GNULIB_TEST_VASPRINTF 1
-
-/* Define to 1 when the gnulib module waitpid should be tested. */
-#define GNULIB_TEST_WAITPID 1
+/* Define to 1 when the gnulib module vfprintf-posix should be tested. */
+#define GNULIB_TEST_VFPRINTF_POSIX 1
-/* Define to 1 when the gnulib module wcrtomb should be tested. */
-#define GNULIB_TEST_WCRTOMB 1
+/* Define to 1 when the gnulib module vsnprintf should be tested. */
+#define GNULIB_TEST_VSNPRINTF 1
-/* Define to 1 when the gnulib module wctob should be tested. */
-#define GNULIB_TEST_WCTOB 1
+/* Define to 1 when the gnulib module vsprintf-posix should be tested. */
+#define GNULIB_TEST_VSPRINTF_POSIX 1
-/* Define to 1 when the gnulib module wctomb should be tested. */
-#define GNULIB_TEST_WCTOMB 1
+/* Define to 1 when the gnulib module waitpid should be tested. */
+#define GNULIB_TEST_WAITPID 1
-/* Define to 1 when the gnulib module write should be tested. */
-#define GNULIB_TEST_WRITE 1
+/* Define to 1 when the gnulib module wcwidth should be tested. */
+#define GNULIB_TEST_WCWIDTH 1
/* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
may be supplied by this distribution. */
@@ -439,11 +314,11 @@
/* Define to 1 if you have the <bp-sym.h> header file. */
/* #undef HAVE_BP_SYM_H */
-/* Define to 1 if you have the `btowc' function. */
-#define HAVE_BTOWC 1
+/* Define if the 'calloc' function is POSIX compliant. */
+#define HAVE_CALLOC_POSIX 1
-/* Define to 1 if you have the `canonicalize_file_name' function. */
-#define HAVE_CANONICALIZE_FILE_NAME 1
+/* Define to 1 if you have the `catgets' function. */
+#define HAVE_CATGETS 1
/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
CoreFoundation framework. */
@@ -453,8 +328,8 @@
the CoreFoundation framework. */
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */
-/* Define to 1 if you have the `closedir' function. */
-#define HAVE_CLOSEDIR 1
+/* Define to 1 if the system has the type `clock_t'. */
+#define HAVE_CLOCK_T 1
/* Define to 1 if you have the `confstr' function. */
/* #undef HAVE_CONFSTR */
@@ -471,23 +346,21 @@
libc. */
/* #undef HAVE_COPYSIGN_IN_LIBC */
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+/* #undef HAVE_DCGETTEXT */
+
/* Define to 1 if you have the declaration of `alarm', and to 0 if you don't.
*/
#define HAVE_DECL_ALARM 1
-#if defined(__linux__)
- #define HAVE_UNLOCKED_IO 1
-#else
- #define HAVE_UNLOCKED_IO 0
-#endif
-
/* Define to 1 if you have the declaration of `clearerr_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_CLEARERR_UNLOCKED 1
-#else
- #define HAVE_DECL_CLEARERR_UNLOCKED 0
-#endif
+#define HAVE_DECL_CLEARERR_UNLOCKED 1
+
+/* Define to 1 if you have the declaration of `clock', and to 0 if you don't.
+ */
+#define HAVE_DECL_CLOCK 0
/* Define to 1 if you have the declaration of `copysign', and to 0 if you
don't. */
@@ -503,103 +376,51 @@
/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FEOF_UNLOCKED 1
-#else
- #define HAVE_DECL_FEOF_UNLOCKED 0
-#endif
+#define HAVE_DECL_FEOF_UNLOCKED 1
/* Define to 1 if you have the declaration of `ferror_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FERROR_UNLOCKED 1
-#else
- #define HAVE_DECL_FERROR_UNLOCKED 0
-#endif
+#define HAVE_DECL_FERROR_UNLOCKED 1
/* Define to 1 if you have the declaration of `fflush_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FFLUSH_UNLOCKED 1
-#else
- #define HAVE_DECL_FFLUSH_UNLOCKED 0
-#endif
+#define HAVE_DECL_FFLUSH_UNLOCKED 1
/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FGETS_UNLOCKED 1
-#else
- #define HAVE_DECL_FGETS_UNLOCKED 0
-#endif
-
-/* Define to 1 if you have the declaration of `fpurge', and to 0 if you don't.
- */
-#define HAVE_DECL_FPURGE 0
+#define HAVE_DECL_FGETS_UNLOCKED 1
/* Define to 1 if you have the declaration of `fputc_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FPUTC_UNLOCKED 1
-#else
- #define HAVE_DECL_FPUTC_UNLOCKED 0
-#endif
+#define HAVE_DECL_FPUTC_UNLOCKED 1
/* Define to 1 if you have the declaration of `fputs_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FPUTS_UNLOCKED 1
-#else
- #define HAVE_DECL_FPUTS_UNLOCKED 0
-#endif
+#define HAVE_DECL_FPUTS_UNLOCKED 1
/* Define to 1 if you have the declaration of `fread_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FREAD_UNLOCKED 1
-#else
- #define HAVE_DECL_FREAD_UNLOCKED 0
-#endif
-
-/* Define to 1 if you have the declaration of `fseeko', and to 0 if you don't.
- */
-#define HAVE_DECL_FSEEKO 1
-
-/* Define to 1 if you have the declaration of `ftello', and to 0 if you don't.
- */
-#define HAVE_DECL_FTELLO 1
+#define HAVE_DECL_FREAD_UNLOCKED 1
/* Define to 1 if you have the declaration of `fwrite_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_FWRITE_UNLOCKED 1
-#else
- #define HAVE_DECL_FWRITE_UNLOCKED 0
-#endif
+#define HAVE_DECL_FWRITE_UNLOCKED 1
/* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_GETCHAR_UNLOCKED 1
-#else
- #define HAVE_DECL_GETCHAR_UNLOCKED 0
-#endif
+#define HAVE_DECL_GETCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_GETC_UNLOCKED 1
-#else
- #define HAVE_DECL_GETC_UNLOCKED 0
-#endif
+#define HAVE_DECL_GETC_UNLOCKED 1
/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
*/
#define HAVE_DECL_GETENV 1
-/* Define to 1 if you have the declaration of `isblank', and to 0 if you
+/* Define to 1 if you have the declaration of `getrusage', and to 0 if you
don't. */
-/* #undef HAVE_DECL_ISBLANK */
+#define HAVE_DECL_GETRUSAGE 1
/* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
don't. */
@@ -609,7 +430,14 @@
don't. */
/* #undef HAVE_DECL_MBSINIT */
-#if defined(__linux__)
+/* Define to 1 if you have a declaration of mbswidth() in <wchar.h>, and to 0
+ otherwise. */
+#define HAVE_DECL_MBSWIDTH_IN_WCHAR_H 0
+
+/* Define to 1 if you have the declaration of `obstack_printf', and to 0 if
+ you don't. */
+#define HAVE_DECL_OBSTACK_PRINTF 1
+
/* Define to 1 if you have the declaration of `program_invocation_name', and
to 0 if you don't. */
#define HAVE_DECL_PROGRAM_INVOCATION_NAME 1
@@ -617,43 +445,14 @@
/* Define to 1 if you have the declaration of `program_invocation_short_name',
and to 0 if you don't. */
#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 1
-#else
-/* Define to 1 if you have the declaration of `program_invocation_name', and
- to 0 if you don't. */
-#define HAVE_DECL_PROGRAM_INVOCATION_NAME 0
-
-/* Define to 1 if you have the declaration of `program_invocation_short_name',
- and to 0 if you don't. */
-#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME 0
-#endif
/* Define to 1 if you have the declaration of `putchar_unlocked', and to 0 if
you don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_PUTCHAR_UNLOCKED 1
-#else
- #define HAVE_DECL_PUTCHAR_UNLOCKED 0
-#endif
+#define HAVE_DECL_PUTCHAR_UNLOCKED 1
/* Define to 1 if you have the declaration of `putc_unlocked', and to 0 if you
don't. */
-#if HAVE_UNLOCKED_IO
- #define HAVE_DECL_PUTC_UNLOCKED 1
-#else
- #define HAVE_DECL_PUTC_UNLOCKED 0
-#endif
-
-/* Define to 1 if you have the declaration of `setenv', and to 0 if you don't.
- */
-#define HAVE_DECL_SETENV 1
-
-/* Define to 1 if you have the declaration of `sigaltstack', and to 0 if you
- don't. */
-#define HAVE_DECL_SIGALTSTACK 1
-
-/* Define to 1 if you have the declaration of `sleep', and to 0 if you don't.
- */
-#define HAVE_DECL_SLEEP 1
+#define HAVE_DECL_PUTC_UNLOCKED 1
/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
don't. */
@@ -675,17 +474,13 @@
don't. */
#define HAVE_DECL_STRNLEN 1
-/* Define to 1 if you have the declaration of `strsignal', and to 0 if you
+/* Define to 1 if you have the declaration of `sysconf', and to 0 if you
don't. */
-#define HAVE_DECL_STRSIGNAL 1
+#define HAVE_DECL_SYSCONF 1
-/* Define to 1 if you have the declaration of `sys_siglist', and to 0 if you
- don't. */
-#if defined(_musl_)
- #define HAVE_DECL_SYS_SIGLIST 0
-#else
- #define HAVE_DECL_SYS_SIGLIST 1
-#endif
+/* Define to 1 if you have the declaration of `times', and to 0 if you don't.
+ */
+#define HAVE_DECL_TIMES 1
/* Define to 1 if you have the declaration of `towlower', and to 0 if you
don't. */
@@ -695,28 +490,21 @@
don't. */
#define HAVE_DECL_UNSETENV 1
-/* Define to 1 if you have the declaration of `wcrtomb', and to 0 if you
+/* Define to 1 if you have the declaration of `vsnprintf', and to 0 if you
don't. */
-/* #undef HAVE_DECL_WCRTOMB */
+#define HAVE_DECL_VSNPRINTF 1
-/* Define to 1 if you have the declaration of `wctob', and to 0 if you don't.
- */
-#define HAVE_DECL_WCTOB 1
-
-/* Define to 1 if you have the declaration of `_putenv', and to 0 if you
+/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you
don't. */
-/* #undef HAVE_DECL__PUTENV */
+#define HAVE_DECL_WCWIDTH 1
/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
don't. */
#define HAVE_DECL__SNPRINTF 0
-/* Define to 1 if you have the declaration of `_sys_siglist', and to 0 if you
+/* Define to 1 if you have the declaration of `__fpending', and to 0 if you
don't. */
-/* #undef HAVE_DECL__SYS_SIGLIST */
-
-/* Define to 1 if you have the <dirent.h> header file. */
-#define HAVE_DIRENT_H 1
+#define HAVE_DECL___FPENDING 1
/* Define to 1 if you have the 'dup2' function. */
#define HAVE_DUP2 1
@@ -728,14 +516,7 @@
#define HAVE_FCNTL 1
/* Define to 1 if you have the <features.h> header file. */
-#if defined(__linux__)
- #define HAVE_FEATURES_H 1
-#else
- #define HAVE_FEATURES_H 0
-#endif
-
-/* Define to 1 if you have the `fpurge' function. */
-/* #undef HAVE_FPURGE */
+#define HAVE_FEATURES_H 1
/* Define if the frexpl function is available in libc. */
#define HAVE_FREXPL_IN_LIBC 1
@@ -743,12 +524,6 @@
/* Define if the frexp function is available in libc. */
#define HAVE_FREXP_IN_LIBC 1
-/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
-#define HAVE_FSEEKO 1
-
-/* Define to 1 if you have the `getcwd' function. */
-#define HAVE_GETCWD 1
-
/* Define to 1 if you have the `getdtablesize' function. */
#define HAVE_GETDTABLESIZE 1
@@ -758,11 +533,11 @@
/* Define to 1 if you have the `getopt_long_only' function. */
#define HAVE_GETOPT_LONG_ONLY 1
-/* Define to 1 if you have the `getpagesize' function. */
-#define HAVE_GETPAGESIZE 1
+/* Define if the GNU gettext() function is already present or preinstalled. */
+/* #undef HAVE_GETTEXT */
-/* Define to 1 if you have the `gettimeofday' function. */
-#define HAVE_GETTIMEOFDAY 1
+/* Define if you have the iconv() function and it works. */
+/* #undef HAVE_ICONV */
/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
#define HAVE_INTMAX_T 1
@@ -774,40 +549,26 @@
declares uintmax_t. */
#define HAVE_INTTYPES_H_WITH_UINTMAX 1
-/* Define to 1 if you have the `isblank' function. */
-#define HAVE_ISBLANK 1
+/* Define to 1 if you have the `isascii' function. */
+#define HAVE_ISASCII 1
-#if defined(_musl_)
-#define HAVE_ISNAND_IN_LIBC 0
-#define HAVE_ISNANF_IN_LIBC 0
-#else
/* Define if the isnan(double) function is available in libc. */
#define HAVE_ISNAND_IN_LIBC 1
/* Define if the isnan(float) function is available in libc. */
#define HAVE_ISNANF_IN_LIBC 1
-#endif
/* Define if the isnan(long double) function is available in libc. */
/* #undef HAVE_ISNANL_IN_LIBC */
-/* Define to 1 if you have the `issetugid' function. */
-/* #undef HAVE_ISSETUGID */
-
/* Define to 1 if you have the `iswcntrl' function. */
#define HAVE_ISWCNTRL 1
-/* Define to 1 if you have the `iswctype' function. */
-#define HAVE_ISWCTYPE 1
-
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
#define HAVE_LANGINFO_CODESET 1
-/* Define to 1 if you have the <langinfo.h> header file. */
-#define HAVE_LANGINFO_H 1
-
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#define HAVE_LC_MESSAGES 1
+/* Define if the ldexpl() function is available. */
+#define HAVE_LDEXPL 1
/* Define if the ldexpl function is available in libc. */
#define HAVE_LDEXPL_IN_LIBC 1
@@ -815,16 +576,10 @@
/* Define if the ldexp function is available in libc. */
#define HAVE_LDEXP_IN_LIBC 1
-/* Define to 1 if you have the <libintl.h> header file. */
-/* #undef HAVE_LIBINTL_H */
-
-/* Define if you have the libsigsegv library. */
-/* #undef HAVE_LIBSIGSEGV */
-
-/* Define to 1 if you have the `link' function. */
-#define HAVE_LINK 1
+/* Define to 1 if you have the <locale.h> header file. */
+#define HAVE_LOCALE_H 1
-/* Define to 1 if the system has the type `long long int'. */
+/* Define to 1 if the system has the type 'long long int'. */
#define HAVE_LONG_LONG_INT 1
/* Define to 1 if you have the `lstat' function. */
@@ -856,17 +611,6 @@
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
-/* Define to 1 if you have the `mempcpy' function. */
-#if defined(__linux__)
-#define HAVE_MEMPCPY 1
-#endif
-
-/* Define to 1 if you have the `mkdtemp' function. */
-#define HAVE_MKDTEMP 1
-
-/* Define to 1 if you have the `mkstemp' function. */
-#define HAVE_MKSTEMP 1
-
/* Define to 1 if you have the `mprotect' function. */
#define HAVE_MPROTECT 1
@@ -874,22 +618,14 @@
concept. */
/* #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER */
-/* Define to 1 if you have the `newlocale' function. */
-#define HAVE_NEWLOCALE 1
-
/* Define to 1 if you have the `nl_langinfo' function. */
-#define HAVE_NL_LANGINFO 1
+/* #undef HAVE_NL_LANGINFO */
/* Define to 1 if libc includes obstacks. */
-#if !defined(_musl_)
#define HAVE_OBSTACK 1
-#endif
-/* Define to 1 if you have the `opendir' function. */
-#define HAVE_OPENDIR 1
-
-/* Define to 1 if you have the <OS.h> header file. */
-/* #undef HAVE_OS_H */
+/* Define to 1 if you have the `obstack_printf' function. */
+#define HAVE_OBSTACK_PRINTF 1
/* Define to 1 if you have the <paths.h> header file. */
/* #undef HAVE_PATHS_H */
@@ -910,10 +646,10 @@
#define HAVE_POSIX_SPAWN_FILE_ACTIONS_T 1
/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
-/* #undef HAVE_PTHREAD_MUTEX_RECURSIVE */
+#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
/* Define if the POSIX multithreading library has read/write locks. */
-/* #undef HAVE_PTHREAD_RWLOCK */
+#define HAVE_PTHREAD_RWLOCK 1
/* Define to 1 if you have the `raise' function. */
#define HAVE_RAISE 1
@@ -921,14 +657,886 @@
/* Define to 1 if you have the `rawmemchr' function. */
#define HAVE_RAWMEMCHR 1
-/* Define to 1 if you have the `readdir' function. */
-#define HAVE_READDIR 1
+/* Define to 1 if acosf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ACOSF 1
+
+/* Define to 1 if acosl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ACOSL 1
+
+/* Define to 1 if asinf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ASINF 1
+
+/* Define to 1 if asinl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ASINL 1
+
+/* Define to 1 if atanf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ATANF 1
+
+/* Define to 1 if atanl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ATANL 1
+
+/* Define to 1 if atoll is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ATOLL 1
+
+/* Define to 1 if btowc is declared even after undefining macros. */
+#define HAVE_RAW_DECL_BTOWC 1
+
+/* Define to 1 if canonicalize_file_name is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_CANONICALIZE_FILE_NAME 1
+
+/* Define to 1 if cbrt is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CBRT 1
+
+/* Define to 1 if cbrtf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CBRTF 1
+
+/* Define to 1 if cbrtl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CBRTL 1
+
+/* Define to 1 if ceilf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CEILF 1
+
+/* Define to 1 if ceill is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CEILL 1
+
+/* Define to 1 if chdir is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CHDIR 1
+
+/* Define to 1 if chown is declared even after undefining macros. */
+#define HAVE_RAW_DECL_CHOWN 1
+
+/* Define to 1 if copysign is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COPYSIGN 1
+
+/* Define to 1 if copysignf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COPYSIGNF 1
+
+/* Define to 1 if copysignl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COPYSIGNL 1
+
+/* Define to 1 if cosf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COSF 1
+
+/* Define to 1 if coshf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COSHF 1
+
+/* Define to 1 if cosl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_COSL 1
+
+/* Define to 1 if dprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_DPRINTF 1
+
+/* Define to 1 if dup is declared even after undefining macros. */
+#define HAVE_RAW_DECL_DUP 1
+
+/* Define to 1 if dup2 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_DUP2 1
+
+/* Define to 1 if dup3 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_DUP3 1
+
+/* Define to 1 if endusershell is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ENDUSERSHELL 1
+
+/* Define to 1 if environ is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ENVIRON 1
+
+/* Define to 1 if euidaccess is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EUIDACCESS 1
+
+/* Define to 1 if exp2 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXP2 1
+
+/* Define to 1 if exp2f is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXP2F 1
+
+/* Define to 1 if exp2l is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXP2L 1
+
+/* Define to 1 if expf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXPF 1
+
+/* Define to 1 if expl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXPL 1
+
+/* Define to 1 if expm1 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXPM1 1
+
+/* Define to 1 if expm1f is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXPM1F 1
+
+/* Define to 1 if expm1l is declared even after undefining macros. */
+#define HAVE_RAW_DECL_EXPM1L 1
+
+/* Define to 1 if fabsf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FABSF 1
+
+/* Define to 1 if fabsl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FABSL 1
+
+/* Define to 1 if faccessat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FACCESSAT 1
+
+/* Define to 1 if fchdir is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FCHDIR 1
+
+/* Define to 1 if fchmodat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FCHMODAT 1
+
+/* Define to 1 if fchownat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FCHOWNAT 1
+
+/* Define to 1 if fcntl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FCNTL 1
+
+/* Define to 1 if fdatasync is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FDATASYNC 1
+
+/* Define to 1 if ffsl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FFSL 1
+
+/* Define to 1 if ffsll is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FFSLL 1
+
+/* Define to 1 if floorf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FLOORF 1
+
+/* Define to 1 if floorl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FLOORL 1
+
+/* Define to 1 if fma is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMA 1
+
+/* Define to 1 if fmaf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMAF 1
+
+/* Define to 1 if fmal is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMAL 1
+
+/* Define to 1 if fmod is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMOD 1
+
+/* Define to 1 if fmodf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMODF 1
+
+/* Define to 1 if fmodl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FMODL 1
+
+/* Define to 1 if fpurge is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_FPURGE */
+
+/* Define to 1 if frexpf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FREXPF 1
+
+/* Define to 1 if frexpl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FREXPL 1
+
+/* Define to 1 if fseeko is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FSEEKO 1
+
+/* Define to 1 if fstat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FSTAT 1
+
+/* Define to 1 if fstatat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FSTATAT 1
+
+/* Define to 1 if fsync is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FSYNC 1
+
+/* Define to 1 if ftello is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FTELLO 1
+
+/* Define to 1 if ftruncate is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FTRUNCATE 1
+
+/* Define to 1 if futimens is declared even after undefining macros. */
+#define HAVE_RAW_DECL_FUTIMENS 1
+
+/* Define to 1 if getcwd is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETCWD 1
+
+/* Define to 1 if getdelim is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETDELIM 1
+
+/* Define to 1 if getdomainname is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETDOMAINNAME 1
+
+/* Define to 1 if getdtablesize is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETDTABLESIZE 1
+
+/* Define to 1 if getgroups is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETGROUPS 1
+
+/* Define to 1 if gethostname is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETHOSTNAME 1
+
+/* Define to 1 if getline is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETLINE 1
+
+/* Define to 1 if getloadavg is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETLOADAVG 1
+
+/* Define to 1 if getlogin is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETLOGIN 1
+
+/* Define to 1 if getlogin_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETLOGIN_R 1
+
+/* Define to 1 if getpagesize is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETPAGESIZE 1
+
+/* Define to 1 if gets is declared even after undefining macros. */
+/* #undef HAVE_RAW_DECL_GETS */
+
+/* Define to 1 if getsubopt is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETSUBOPT 1
+
+/* Define to 1 if getusershell is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GETUSERSHELL 1
+
+/* Define to 1 if grantpt is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GRANTPT 1
+
+/* Define to 1 if group_member is declared even after undefining macros. */
+#define HAVE_RAW_DECL_GROUP_MEMBER 1
+
+/* Define to 1 if hypotf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_HYPOTF 1
+
+/* Define to 1 if hypotl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_HYPOTL 1
+
+/* Define to 1 if ilogb is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ILOGB 1
+
+/* Define to 1 if ilogbf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ILOGBF 1
+
+/* Define to 1 if ilogbl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ILOGBL 1
+
+/* Define to 1 if imaxabs is declared even after undefining macros. */
+#define HAVE_RAW_DECL_IMAXABS 1
+
+/* Define to 1 if imaxdiv is declared even after undefining macros. */
+#define HAVE_RAW_DECL_IMAXDIV 1
+
+/* Define to 1 if initstate is declared even after undefining macros. */
+#define HAVE_RAW_DECL_INITSTATE 1
+
+/* Define to 1 if initstate_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_INITSTATE_R 1
+
+/* Define to 1 if isatty is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ISATTY 1
+
+/* Define to 1 if iswctype is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ISWCTYPE 1
+
+/* Define to 1 if lchmod is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LCHMOD 1
+
+/* Define to 1 if lchown is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LCHOWN 1
+
+/* Define to 1 if ldexpf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LDEXPF 1
+
+/* Define to 1 if ldexpl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LDEXPL 1
+
+/* Define to 1 if link is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LINK 1
+
+/* Define to 1 if linkat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LINKAT 1
+
+/* Define to 1 if log is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG 1
+
+/* Define to 1 if log10 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG10 1
+
+/* Define to 1 if log10f is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG10F 1
+
+/* Define to 1 if log10l is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG10L 1
+
+/* Define to 1 if log1p is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG1P 1
+
+/* Define to 1 if log1pf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG1PF 1
+
+/* Define to 1 if log1pl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG1PL 1
+
+/* Define to 1 if log2 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG2 1
+
+/* Define to 1 if log2f is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG2F 1
+
+/* Define to 1 if log2l is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOG2L 1
+
+/* Define to 1 if logb is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOGB 1
+
+/* Define to 1 if logbf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOGBF 1
+
+/* Define to 1 if logbl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOGBL 1
+
+/* Define to 1 if logf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOGF 1
+
+/* Define to 1 if logl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LOGL 1
+
+/* Define to 1 if lseek is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LSEEK 1
+
+/* Define to 1 if lstat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_LSTAT 1
-/* Define to 1 if you have the `readlink' function. */
-#define HAVE_READLINK 1
+/* Define to 1 if mbrlen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MBRLEN 1
-/* Define to 1 if you have the `realpath' function. */
-#define HAVE_REALPATH 1
+/* Define to 1 if mbrtowc is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MBRTOWC 1
+
+/* Define to 1 if mbsinit is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MBSINIT 1
+
+/* Define to 1 if mbsnrtowcs is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MBSNRTOWCS 1
+
+/* Define to 1 if mbsrtowcs is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MBSRTOWCS 1
+
+/* Define to 1 if memmem is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MEMMEM 1
+
+/* Define to 1 if mempcpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MEMPCPY 1
+
+/* Define to 1 if memrchr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MEMRCHR 1
+
+/* Define to 1 if mkdirat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKDIRAT 1
+
+/* Define to 1 if mkdtemp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKDTEMP 1
+
+/* Define to 1 if mkfifo is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKFIFO 1
+
+/* Define to 1 if mkfifoat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKFIFOAT 1
+
+/* Define to 1 if mknod is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKNOD 1
+
+/* Define to 1 if mknodat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKNODAT 1
+
+/* Define to 1 if mkostemp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKOSTEMP 1
+
+/* Define to 1 if mkostemps is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKOSTEMPS 1
+
+/* Define to 1 if mkstemp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKSTEMP 1
+
+/* Define to 1 if mkstemps is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MKSTEMPS 1
+
+/* Define to 1 if modf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MODF 1
+
+/* Define to 1 if modff is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MODFF 1
+
+/* Define to 1 if modfl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_MODFL 1
+
+/* Define to 1 if openat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_OPENAT 1
+
+/* Define to 1 if pclose is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PCLOSE 1
+
+/* Define to 1 if pipe is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PIPE 1
+
+/* Define to 1 if pipe2 is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PIPE2 1
+
+/* Define to 1 if popen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_POPEN 1
+
+/* Define to 1 if posix_openpt is declared even after undefining macros. */
+#define HAVE_RAW_DECL_POSIX_OPENPT 1
+
+/* Define to 1 if posix_spawn is declared even after undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN 1
+
+/* Define to 1 if posix_spawnattr_destroy is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_DESTROY 1
+
+/* Define to 1 if posix_spawnattr_getflags is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETFLAGS 1
+
+/* Define to 1 if posix_spawnattr_getpgroup is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETPGROUP 1
+
+/* Define to 1 if posix_spawnattr_getschedparam is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM 1
+
+/* Define to 1 if posix_spawnattr_getschedpolicy is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY 1
+
+/* Define to 1 if posix_spawnattr_getsigdefault is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGDEFAULT 1
+
+/* Define to 1 if posix_spawnattr_getsigmask is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSIGMASK 1
+
+/* Define to 1 if posix_spawnattr_init is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_INIT 1
+
+/* Define to 1 if posix_spawnattr_setflags is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETFLAGS 1
+
+/* Define to 1 if posix_spawnattr_setpgroup is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETPGROUP 1
+
+/* Define to 1 if posix_spawnattr_setschedparam is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM 1
+
+/* Define to 1 if posix_spawnattr_setschedpolicy is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY 1
+
+/* Define to 1 if posix_spawnattr_setsigdefault is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGDEFAULT 1
+
+/* Define to 1 if posix_spawnattr_setsigmask is declared even after undefining
+ macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSIGMASK 1
+
+/* Define to 1 if posix_spawnp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWNP 1
+
+/* Define to 1 if posix_spawn_file_actions_addclose is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 1
+
+/* Define to 1 if posix_spawn_file_actions_adddup2 is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1
+
+/* Define to 1 if posix_spawn_file_actions_addopen is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 1
+
+/* Define to 1 if posix_spawn_file_actions_destroy is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_DESTROY 1
+
+/* Define to 1 if posix_spawn_file_actions_init is declared even after
+ undefining macros. */
+#define HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_INIT 1
+
+/* Define to 1 if powf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_POWF 1
+
+/* Define to 1 if pread is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PREAD 1
+
+/* Define to 1 if pthread_sigmask is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PTHREAD_SIGMASK 1
+
+/* Define to 1 if ptsname is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PTSNAME 1
+
+/* Define to 1 if ptsname_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PTSNAME_R 1
+
+/* Define to 1 if pwrite is declared even after undefining macros. */
+#define HAVE_RAW_DECL_PWRITE 1
+
+/* Define to 1 if random is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RANDOM 1
+
+/* Define to 1 if random_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RANDOM_R 1
+
+/* Define to 1 if rawmemchr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RAWMEMCHR 1
+
+/* Define to 1 if readlink is declared even after undefining macros. */
+#define HAVE_RAW_DECL_READLINK 1
+
+/* Define to 1 if readlinkat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_READLINKAT 1
+
+/* Define to 1 if realpath is declared even after undefining macros. */
+#define HAVE_RAW_DECL_REALPATH 1
+
+/* Define to 1 if remainder is declared even after undefining macros. */
+#define HAVE_RAW_DECL_REMAINDER 1
+
+/* Define to 1 if remainderf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_REMAINDERF 1
+
+/* Define to 1 if remainderl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_REMAINDERL 1
+
+/* Define to 1 if renameat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RENAMEAT 1
+
+/* Define to 1 if rint is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RINT 1
+
+/* Define to 1 if rintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RINTF 1
+
+/* Define to 1 if rintl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RINTL 1
+
+/* Define to 1 if rmdir is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RMDIR 1
+
+/* Define to 1 if round is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ROUND 1
+
+/* Define to 1 if roundf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ROUNDF 1
+
+/* Define to 1 if roundl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_ROUNDL 1
+
+/* Define to 1 if rpmatch is declared even after undefining macros. */
+#define HAVE_RAW_DECL_RPMATCH 1
+
+/* Define to 1 if secure_getenv is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SECURE_GETENV 1
+
+/* Define to 1 if setenv is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SETENV 1
+
+/* Define to 1 if sethostname is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SETHOSTNAME 1
+
+/* Define to 1 if setstate is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SETSTATE 1
+
+/* Define to 1 if setstate_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SETSTATE_R 1
+
+/* Define to 1 if setusershell is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SETUSERSHELL 1
+
+/* Define to 1 if sigaction is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGACTION 1
+
+/* Define to 1 if sigaddset is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGADDSET 1
+
+/* Define to 1 if sigdelset is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGDELSET 1
+
+/* Define to 1 if sigemptyset is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGEMPTYSET 1
+
+/* Define to 1 if sigfillset is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGFILLSET 1
+
+/* Define to 1 if sigismember is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGISMEMBER 1
+
+/* Define to 1 if sigpending is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGPENDING 1
+
+/* Define to 1 if sigprocmask is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SIGPROCMASK 1
+
+/* Define to 1 if sinf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SINF 1
+
+/* Define to 1 if sinhf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SINHF 1
+
+/* Define to 1 if sinl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SINL 1
+
+/* Define to 1 if sleep is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SLEEP 1
+
+/* Define to 1 if snprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SNPRINTF 1
+
+/* Define to 1 if sqrtf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SQRTF 1
+
+/* Define to 1 if sqrtl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SQRTL 1
+
+/* Define to 1 if srandom is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SRANDOM 1
+
+/* Define to 1 if srandom_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SRANDOM_R 1
+
+/* Define to 1 if stat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STAT 1
+
+/* Define to 1 if stpcpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STPCPY 1
+
+/* Define to 1 if stpncpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STPNCPY 1
+
+/* Define to 1 if strcasestr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRCASESTR 1
+
+/* Define to 1 if strchrnul is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRCHRNUL 1
+
+/* Define to 1 if strdup is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRDUP 1
+
+/* Define to 1 if strerror_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRERROR_R 1
+
+/* Define to 1 if strncat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRNCAT 1
+
+/* Define to 1 if strndup is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRNDUP 1
+
+/* Define to 1 if strnlen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRNLEN 1
+
+/* Define to 1 if strpbrk is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRPBRK 1
+
+/* Define to 1 if strsep is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRSEP 1
+
+/* Define to 1 if strsignal is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRSIGNAL 1
+
+/* Define to 1 if strtod is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOD 1
+
+/* Define to 1 if strtoimax is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOIMAX 1
+
+/* Define to 1 if strtok_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOK_R 1
+
+/* Define to 1 if strtoll is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOLL 1
+
+/* Define to 1 if strtoull is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOULL 1
+
+/* Define to 1 if strtoumax is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRTOUMAX 1
+
+/* Define to 1 if strverscmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_STRVERSCMP 1
+
+/* Define to 1 if symlink is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SYMLINK 1
+
+/* Define to 1 if symlinkat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_SYMLINKAT 1
+
+/* Define to 1 if tanf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TANF 1
+
+/* Define to 1 if tanhf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TANHF 1
+
+/* Define to 1 if tanl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TANL 1
+
+/* Define to 1 if tmpfile is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TMPFILE 1
+
+/* Define to 1 if towctrans is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TOWCTRANS 1
+
+/* Define to 1 if trunc is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TRUNC 1
+
+/* Define to 1 if truncf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TRUNCF 1
+
+/* Define to 1 if truncl is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TRUNCL 1
+
+/* Define to 1 if ttyname_r is declared even after undefining macros. */
+#define HAVE_RAW_DECL_TTYNAME_R 1
+
+/* Define to 1 if unlink is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UNLINK 1
+
+/* Define to 1 if unlinkat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UNLINKAT 1
+
+/* Define to 1 if unlockpt is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UNLOCKPT 1
+
+/* Define to 1 if unsetenv is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UNSETENV 1
+
+/* Define to 1 if usleep is declared even after undefining macros. */
+#define HAVE_RAW_DECL_USLEEP 1
+
+/* Define to 1 if utimensat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_UTIMENSAT 1
+
+/* Define to 1 if vdprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_VDPRINTF 1
+
+/* Define to 1 if vsnprintf is declared even after undefining macros. */
+#define HAVE_RAW_DECL_VSNPRINTF 1
+
+/* Define to 1 if waitpid is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WAITPID 1
+
+/* Define to 1 if wcpcpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCPCPY 1
+
+/* Define to 1 if wcpncpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCPNCPY 1
+
+/* Define to 1 if wcrtomb is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCRTOMB 1
+
+/* Define to 1 if wcscasecmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCASECMP 1
+
+/* Define to 1 if wcscat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCAT 1
+
+/* Define to 1 if wcschr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCHR 1
+
+/* Define to 1 if wcscmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCMP 1
+
+/* Define to 1 if wcscoll is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCOLL 1
+
+/* Define to 1 if wcscpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCPY 1
+
+/* Define to 1 if wcscspn is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSCSPN 1
+
+/* Define to 1 if wcsdup is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSDUP 1
+
+/* Define to 1 if wcslen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSLEN 1
+
+/* Define to 1 if wcsncasecmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNCASECMP 1
+
+/* Define to 1 if wcsncat is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNCAT 1
+
+/* Define to 1 if wcsncmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNCMP 1
+
+/* Define to 1 if wcsncpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNCPY 1
+
+/* Define to 1 if wcsnlen is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNLEN 1
+
+/* Define to 1 if wcsnrtombs is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSNRTOMBS 1
+
+/* Define to 1 if wcspbrk is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSPBRK 1
+
+/* Define to 1 if wcsrchr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSRCHR 1
+
+/* Define to 1 if wcsrtombs is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSRTOMBS 1
+
+/* Define to 1 if wcsspn is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSSPN 1
+
+/* Define to 1 if wcsstr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSSTR 1
+
+/* Define to 1 if wcstok is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSTOK 1
+
+/* Define to 1 if wcswidth is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSWIDTH 1
+
+/* Define to 1 if wcsxfrm is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCSXFRM 1
+
+/* Define to 1 if wctob is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCTOB 1
+
+/* Define to 1 if wctrans is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCTRANS 1
+
+/* Define to 1 if wctype is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCTYPE 1
+
+/* Define to 1 if wcwidth is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WCWIDTH 1
+
+/* Define to 1 if wmemchr is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WMEMCHR 1
+
+/* Define to 1 if wmemcmp is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WMEMCMP 1
+
+/* Define to 1 if wmemcpy is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WMEMCPY 1
+
+/* Define to 1 if wmemmove is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WMEMMOVE 1
+
+/* Define to 1 if wmemset is declared even after undefining macros. */
+#define HAVE_RAW_DECL_WMEMSET 1
+
+/* Define to 1 if _Exit is declared even after undefining macros. */
+#define HAVE_RAW_DECL__EXIT 1
+
+/* Define if the 'realloc' function is POSIX compliant. */
+#define HAVE_REALLOC_POSIX 1
/* Define to 1 if 'long double' and 'double' have the same representation. */
/* #undef HAVE_SAME_LONG_DOUBLE_AS_DOUBLE */
@@ -942,27 +1550,15 @@
/* Define to 1 if you have the `sched_setscheduler' function. */
/* #undef HAVE_SCHED_SETSCHEDULER */
-/* Define to 1 if you have the <search.h> header file. */
-#define HAVE_SEARCH_H 1
-
-/* Define to 1 if you have the `secure_getenv' function. */
-/* #undef HAVE_SECURE_GETENV */
-
/* Define to 1 if you have the `setegid' function. */
/* #undef HAVE_SETEGID */
-/* Define to 1 if you have the `setenv' function. */
-#define HAVE_SETENV 1
-
/* Define to 1 if you have the `seteuid' function. */
/* #undef HAVE_SETEUID */
/* Define to 1 if you have the `setlocale' function. */
#define HAVE_SETLOCALE 1
-/* Define to 1 if you have the `setrlimit' function. */
-#define HAVE_SETRLIMIT 1
-
/* Define to 1 if you have the `sigaction' function. */
#define HAVE_SIGACTION 1
@@ -990,9 +1586,6 @@
/* Define to 1 if the system has the type `sig_atomic_t'. */
#define HAVE_SIG_ATOMIC_T 1
-/* Define to 1 if you have the `sleep' function. */
-#define HAVE_SLEEP 1
-
/* Define to 1 if you have the `snprintf' function. */
#define HAVE_SNPRINTF 1
@@ -1004,13 +1597,6 @@
/* Define to 1 if you have the <spawn.h> header file. */
#define HAVE_SPAWN_H 1
-/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV
- which can be handled on an alternate stack established with sigaltstack. */
-#define HAVE_STACK_OVERFLOW_HANDLING 1
-
-/* Define to 1 if the system has the type `stack_t'. */
-#define HAVE_STACK_T 1
-
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
@@ -1019,15 +1605,14 @@
#define HAVE_STDINT_H_WITH_UINTMAX 1
/* Define to 1 if you have the <stdio_ext.h> header file. */
-#if defined(__FreeBSD__) || defined(__MACH__)
-#define HAVE_STDIO_EXT_H 0
-#else
#define HAVE_STDIO_EXT_H 1
-#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
+/* Define to 1 if you have the `stpcpy' function. */
+#define HAVE_STPCPY 1
+
/* Define to 1 if you have the `strchrnul' function. */
#define HAVE_STRCHRNUL 1
@@ -1049,15 +1634,18 @@
/* Define to 1 if you have the `strnlen' function. */
#define HAVE_STRNLEN 1
-/* Define to 1 if you have the `strsignal' function. */
-#define HAVE_STRSIGNAL 1
-
-/* Define to 1 if `decimal_point' is a member of `struct lconv'. */
-/* #undef HAVE_STRUCT_LCONV_DECIMAL_POINT */
+/* Define to 1 if you have the `strtoul' function. */
+#define HAVE_STRTOUL 1
/* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
+/* Define to 1 if the system has the type `struct tms'. */
+#define HAVE_STRUCT_TMS 1
+
+/* Define to 1 if you have the `strverscmp' function. */
+#define HAVE_STRVERSCMP 1
+
/* Define to 1 if you have the `symlink' function. */
#define HAVE_SYMLINK 1
@@ -1073,14 +1661,17 @@
/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define HAVE_SYS_RESOURCE_H 1
+
/* Define to 1 if you have the <sys/socket.h> header file. */
#define HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-/* #undef HAVE_SYS_TIMEB_H */
+/* Define to 1 if you have the <sys/times.h> header file. */
+#define HAVE_SYS_TIMES_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
@@ -1091,15 +1682,12 @@
/* Define to 1 if you have the <sys/wait.h> header file. */
#define HAVE_SYS_WAIT_H 1
+/* Define to 1 if you have the `times' function. */
+#define HAVE_TIMES 1
+
/* Define to 1 if you have the `towlower' function. */
#define HAVE_TOWLOWER 1
-/* Define to 1 if you have the `tsearch' function. */
-#define HAVE_TSEARCH 1
-
-/* Define to 1 if you have the <ucontext.h> header file. */
-#define HAVE_UCONTEXT_H 1
-
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
@@ -1109,18 +1697,15 @@
/* Define to 1 if the system has the type 'unsigned long long int'. */
#define HAVE_UNSIGNED_LONG_LONG_INT 1
-/* Define to 1 if you have the `uselocale' function. */
-#define HAVE_USELOCALE 1
-
/* Define to 1 if you have the `vasnprintf' function. */
/* #undef HAVE_VASNPRINTF */
-/* Define to 1 if you have the `vasprintf' function. */
-#define HAVE_VASPRINTF 1
-
/* Define to 1 if you have the `vfork' function. */
/* #undef HAVE_VFORK */
+/* Define to 1 if you have the `vsnprintf' function. */
+#define HAVE_VSNPRINTF 1
+
/* Define to 1 if you have the `waitid' function. */
#define HAVE_WAITID 1
@@ -1133,21 +1718,18 @@
/* Define to 1 if you have the `wcrtomb' function. */
#define HAVE_WCRTOMB 1
-/* Define to 1 if you have the `wcscoll' function. */
-#define HAVE_WCSCOLL 1
-
/* Define to 1 if you have the `wcslen' function. */
#define HAVE_WCSLEN 1
/* Define to 1 if you have the `wcsnlen' function. */
#define HAVE_WCSNLEN 1
-/* Define to 1 if you have the `wctob' function. */
-#define HAVE_WCTOB 1
-
/* Define to 1 if you have the <wctype.h> header file. */
#define HAVE_WCTYPE_H 1
+/* Define to 1 if you have the `wcwidth' function. */
+#define HAVE_WCWIDTH 1
+
/* Define to 1 if you have the <winsock2.h> header file. */
/* #undef HAVE_WINSOCK2_H */
@@ -1164,63 +1746,27 @@
work. */
#define HAVE_WORKING_POSIX_SPAWN 1
-/* Define to 1 if you have the <xlocale.h> header file. */
-#define HAVE_XLOCALE_H 1
-
-/* Define to 1 if the system has the type `clock_t'. */
-#define HAVE_CLOCK_T 1
-
-/* Define to 1 if extending the stack slightly past the limit causes a
- SIGSEGV, and an alternate stack can be established with sigaltstack, and
- the signal handler is passed a context that specifies the run time stack.
- This behavior is defined by POSIX 1003.1-2001 with the X/Open System
- Interface (XSI) option and is a standardized way to implement a SEGV-based
- stack overflow detection heuristic. */
-/* #undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC */
-
/* Define to 1 if the system has the type `_Bool'. */
#define HAVE__BOOL 1
-/* Define to 1 if you have the `_fseeki64' function. */
-/* #undef HAVE__FSEEKI64 */
-
-/* Define to 1 if you have the `_ftelli64' function. */
-/* #undef HAVE__FTELLI64 */
-
-/* Define to 1 if you have the `_ftime' function. */
-/* #undef HAVE__FTIME */
-
/* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
/* #undef HAVE__SET_INVALID_PARAMETER_HANDLER */
-/* Define to 1 if you have the `__fpurge' function. */
-#if HAVE_STDIO_EXT_H
- #define HAVE___FPURGE 1
-#else
- #define HAVE___FPURGE 0
-#endif
+/* Define to 1 if you have the `__fpending' function. */
+#define HAVE___FPENDING 1
-#if defined(_musl_)
- /* Define to 1 if you have the `__freadahead' function. */
- #define HAVE___FREADAHEAD 1
-#endif
+/* Define to 1 if you have the `__fseterr' function. */
+/* #undef HAVE___FSETERR */
-/* Define to 1 if you have the `__freading' function. */
-#if HAVE_STDIO_EXT_H
- #define HAVE___FREADING 1
-#else
- #define HAVE___FREADING 0
-#endif
-
-/* Define to 1 if you have the `__secure_getenv' function. */
-//#define HAVE___SECURE_GETENV 1
+/* Define to 1 if you have the `__xpg_strerror_r' function. */
+#define HAVE___XPG_STRERROR_R 1
/* Define as the bit index in the word where to find bit 0 of the exponent of
'long double'. */
-#define LDBL_EXPBIT0_BIT 0
+/* #undef LDBL_EXPBIT0_BIT */
/* Define as the word index where to find the exponent of 'long double'. */
-#define LDBL_EXPBIT0_WORD 2
+/* #undef LDBL_EXPBIT0_WORD */
/* Define as the bit index in the word where to find the sign of 'long
double'. */
@@ -1229,15 +1775,11 @@
/* Define as the word index where to find the sign of 'long double'. */
/* #undef LDBL_SIGNBIT_WORD */
-/* Define to 1 if lseek does not detect pipes. */
-/* #undef LSEEK_PIPE_BROKEN */
-
-/* Define to 1 if 'lstat' dereferences a symlink specified with a trailing
- slash. */
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
+/* Define to the GNU M4 executable name. */
+#define M4 "/var/empty/gnum4-1.4.19/bin/m4"
-/* If malloc(0) is != NULL, define this to 1. Otherwise define this to 0. */
-#define MALLOC_0_IS_NONNULL 1
+/* Define to "-g" if GNU M4 supports -g, otherwise to "". */
+#define M4_GNU_OPTION "--gnu"
/* Define to a substitute value for mmap()'s MAP_ANONYMOUS flag. */
/* #undef MAP_ANONYMOUS */
@@ -1309,34 +1851,28 @@
/* #undef OPEN_TRAILING_SLASH_BUG */
/* Name of package */
-#define PACKAGE "m4"
+#define PACKAGE "bison"
/* Define to the address where bug reports for this package should be sent. */
-#define PACKAGE_BUGREPORT "bug-m4@gnu.org"
-
-/* Define to the full name of this package. */
-#define PACKAGE_NAME "GNU M4"
-
-/* String identifying the packager of this software */
-/* #undef PACKAGE_PACKAGER */
+#define PACKAGE_BUGREPORT "bug-bison@gnu.org"
-/* Packager info for bug reports (URL/e-mail/...) */
-/* #undef PACKAGE_PACKAGER_BUG_REPORTS */
+/* The copyright year for this package */
+#define PACKAGE_COPYRIGHT_YEAR 2013
-/* Packager-specific version information */
-/* #undef PACKAGE_PACKAGER_VERSION */
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU Bison"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU M4 3.0.0"
+#define PACKAGE_STRING "GNU Bison 3.0"
/* Define to the one symbol short name of this package. */
-#define PACKAGE_TARNAME "m4"
+#define PACKAGE_TARNAME "bison"
/* Define to the home page for this package. */
-#define PACKAGE_URL "http://www.gnu.org/software/m4/"
+#define PACKAGE_URL "http://www.gnu.org/software/bison/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "3.0.0"
+#define PACKAGE_VERSION "3.0"
/* the number of pending output bytes on stream 'fp' */
/* #undef PENDING_OUTPUT_N_BYTES */
@@ -1355,27 +1891,9 @@
'ptrdiff_t'. */
/* #undef PTRDIFF_T_SUFFIX */
-/* Define to 1 if readlink fails to recognize a trailing slash. */
-/* #undef READLINK_TRAILING_SLASH_BUG */
-
-/* Define if rename does not work when the destination file exists, as on
- Cygwin 1.5 or Windows. */
-/* #undef RENAME_DEST_EXISTS_BUG */
-
-/* Define if rename fails to leave hard links alone, as on NetBSD 1.6 or
- Cygwin 1.5. */
-/* #undef RENAME_HARD_LINK_BUG */
-
-/* Define to 1 if a file can be renamed while open, or to 0 if not. */
-#define RENAME_OPEN_FILE_WORKS 1
-
-/* Define if rename does not correctly handle slashes on the destination
- argument, such as on Solaris 10 or NetBSD 1.6. */
-/* #undef RENAME_TRAILING_SLASH_DEST_BUG */
-
-/* Define if rename does not correctly handle slashes on the source argument,
- such as on Solaris 9 or cygwin 1.5. */
-/* #undef RENAME_TRAILING_SLASH_SOURCE_BUG */
+/* Define if fprintf is overridden by a POSIX compliant gnulib implementation.
+ */
+#define REPLACE_FPRINTF_POSIX 1
/* Define to 1 if stat needs help when passed a directory name with a trailing
slash */
@@ -1385,8 +1903,9 @@
slash */
/* #undef REPLACE_FUNC_STAT_FILE */
-/* Define if nl_langinfo exists but is overridden by gnulib. */
-/* #undef REPLACE_NL_LANGINFO */
+/* Define if printf is overridden by a POSIX compliant gnulib implementation.
+ */
+#define REPLACE_PRINTF_POSIX 1
/* Define to 1 if strerror(0) does not return a message implying success. */
/* #undef REPLACE_STRERROR_0 */
@@ -1394,13 +1913,9 @@
/* Define if vasnprintf exists but is overridden by gnulib. */
/* #undef REPLACE_VASNPRINTF */
-/* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as
- the highest address of the alternate stack range rather than as the lowest
- address. */
-/* #undef SIGALTSTACK_SS_REVERSED */
-
-/* Define if lists must be signal-safe. */
-#define SIGNAL_SAFE_LIST 1
+/* Define if vfprintf is overridden by a POSIX compliant gnulib
+ implementation. */
+#define REPLACE_VFPRINTF_POSIX 1
/* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
'sig_atomic_t'. */
@@ -1433,19 +1948,16 @@
/* Define to 1 if strerror_r returns char *. */
#define STRERROR_R_CHAR_P 1
-/* Shell used by syscmd and esyscmd, must accept -c argument. */
-#define SYSCMD_SHELL "/bin/sh"
-
/* Define to the prefix of C symbols at the assembler and linker level, either
an underscore or empty. */
-#define USER_LABEL_PREFIX
+#define USER_LABEL_PREFIX
/* Define if the POSIX multithreading library can be used. */
-/* #undef USE_POSIX_THREADS */
+#define USE_POSIX_THREADS 1
/* Define if references to the POSIX multithreading library should be made
weak. */
-/* #undef USE_POSIX_THREADS_WEAK */
+#define USE_POSIX_THREADS_WEAK 1
/* Define if the GNU Pth multithreading library can be used. */
/* #undef USE_PTH_THREADS */
@@ -1502,7 +2014,7 @@
/* #undef USE_WINDOWS_THREADS */
/* Version number of package */
-#define VERSION "3.0.0"
+#define VERSION "3.0"
/* Define to 1 if unsetenv returns void instead of int. */
/* #undef VOID_UNSETENV */
@@ -1515,7 +2027,7 @@
'wint_t'. */
/* #undef WINT_T_SUFFIX */
-/* Define to 1 if malloc debugging is enabled */
+/* Define if using the dmalloc debugging malloc package */
/* #undef WITH_DMALLOC */
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
@@ -1530,6 +2042,13 @@
# endif
#endif
+/* Define to 1 to internationalize bison runtime messages. */
+/* #undef YYENABLE_NLS */
+
+/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
+ `char[]'. */
+/* #undef YYTEXT_POINTER */
+
/* Enable large inode numbers on Mac OS X 10.5. */
#define _DARWIN_USE_64_BIT_INODE 1
@@ -1540,15 +2059,9 @@
stat.st_size becomes 64-bit. */
/* #undef _GL_WINDOWS_64_BIT_ST_SIZE */
-/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
-/* #undef _LARGEFILE_SOURCE */
-
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
-/* Define to 1 on Solaris. */
-/* #undef _LCONV_C99 */
-
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
@@ -1576,16 +2089,9 @@
/* Define to 1 if you need to in order for 'stat' and other things to work. */
/* #undef _POSIX_SOURCE */
-/* Define if you want <regex.h> to include <limits.h>, so that it consistently
- overrides <limits.h>'s RE_DUP_MAX. */
-/* #undef _REGEX_INCLUDE_LIMITS_H */
-
-/* Define if you want regoff_t to be at least as wide POSIX requires. */
-/* #undef _REGEX_LARGE_OFFSETS */
-
/* Define to rpl_ if the getopt replacement functions and variables should be
used. */
-#define __GETOPT_PREFIX rpl_
+/* #undef __GETOPT_PREFIX */
/* Please see the Gnulib manual for how to use these macros.
@@ -1598,28 +2104,20 @@
'reference to static identifier "f" in extern inline function'.
This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
- Suppress the use of extern inline on problematic Apple configurations, as
- Libc at least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
+ Suppress the use of extern inline on Apple's platforms, as Libc at least
+ through Libc-825.26 (2013-04-09) is incompatible with it; see, e.g.,
<http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
Perhaps Apple will fix this some day. */
-#if (defined __APPLE__ \
- && ((! defined _DONT_USE_CTYPE_INLINE_ \
- && (defined __GNUC__ || defined __cplusplus)) \
- || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
- && defined __GNUC__ && ! defined __cplusplus)))
-# define _GL_EXTERN_INLINE_APPLE_BUG
-#endif
#if ((__GNUC__ \
? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
: (199901L <= __STDC_VERSION__ \
&& !defined __HP_cc \
&& !(defined __SUNPRO_C && __STDC__))) \
- && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+ && !defined __APPLE__)
# define _GL_INLINE inline
# define _GL_EXTERN_INLINE extern inline
-# define _GL_EXTERN_INLINE_IN_USE
#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
- && !defined _GL_EXTERN_INLINE_APPLE_BUG)
+ && !defined __APPLE__)
# if __GNUC_GNU_INLINE__
/* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
@@ -1627,7 +2125,6 @@
# define _GL_INLINE extern inline
# endif
# define _GL_EXTERN_INLINE extern
-# define _GL_EXTERN_INLINE_IN_USE
#else
# define _GL_INLINE static _GL_UNUSED
# define _GL_EXTERN_INLINE static _GL_UNUSED
@@ -1659,12 +2156,6 @@
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
-/* A replacement for va_copy, if needed. */
-#define gl_va_copy(a,b) ((a) = (b))
-
-/* Define to rpl_gmtime if the replacement function should be used. */
-/* #undef gmtime */
-
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
@@ -1684,9 +2175,6 @@
# define __GNUC_STDC_INLINE__ 1
#endif
-/* Define to rpl_localtime if the replacement function should be used. */
-/* #undef localtime */
-
/* Define to a type if <wchar.h> does not define. */
/* #undef mbstate_t */
@@ -1703,51 +2191,6 @@
doesn't define it. */
/* #undef ptrdiff_t */
-/* Define to rpl_re_comp if the replacement should be used. */
-/* #undef re_comp */
-
-/* Define to rpl_re_compile_fastmap if the replacement should be used. */
-/* #undef re_compile_fastmap */
-
-/* Define to rpl_re_compile_pattern if the replacement should be used. */
-/* #undef re_compile_pattern */
-
-/* Define to rpl_re_exec if the replacement should be used. */
-/* #undef re_exec */
-
-/* Define to rpl_re_match if the replacement should be used. */
-/* #undef re_match */
-
-/* Define to rpl_re_match_2 if the replacement should be used. */
-/* #undef re_match_2 */
-
-/* Define to rpl_re_search if the replacement should be used. */
-/* #undef re_search */
-
-/* Define to rpl_re_search_2 if the replacement should be used. */
-/* #undef re_search_2 */
-
-/* Define to rpl_re_set_registers if the replacement should be used. */
-/* #undef re_set_registers */
-
-/* Define to rpl_re_set_syntax if the replacement should be used. */
-/* #undef re_set_syntax */
-
-/* Define to rpl_re_syntax_options if the replacement should be used. */
-/* #undef re_syntax_options */
-
-/* Define to rpl_regcomp if the replacement should be used. */
-/* #undef regcomp */
-
-/* Define to rpl_regerror if the replacement should be used. */
-/* #undef regerror */
-
-/* Define to rpl_regexec if the replacement should be used. */
-/* #undef regexec */
-
-/* Define to rpl_regfree if the replacement should be used. */
-/* #undef regfree */
-
/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
supported directly. */
@@ -1801,8 +2244,3 @@
# define _GL_ATTRIBUTE_CONST /* empty */
#endif
-
-/* Define as a macro for copying va_list variables. */
-/* #undef va_copy */
-
-#define M4_GNU_OPTION "--gnu"
diff --git a/contrib/tools/bison/lib/config-osx.h b/contrib/tools/bison/lib/config-osx.h
index 59bffc235a..73cfff6950 100644
--- a/contrib/tools/bison/lib/config-osx.h
+++ b/contrib/tools/bison/lib/config-osx.h
@@ -1,3 +1,33 @@
+#pragma once
+
#include "config-linux.h"
+#undef HAVE_DECL___FPENDING
+#undef HAVE_STDIO_EXT_H
+
+#undef HAVE___FSETERR
+
+#undef HAVE_FEATURES_H
+
+#undef HAVE_DECL_PROGRAM_INVOCATION_NAME
+#undef HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME
+
+#undef HAVE_OBSTACK
+#undef HAVE_OBSTACK_PRINTF
+
+// fread_unlocked should be controlled by USE_UNLOCKED_IO, yet it is not
+#undef USE_UNLOCKED_IO
+#undef HAVE_DECL_FEOF_UNLOCKED
+#undef HAVE_DECL_FERROR_UNLOCKED
+#undef HAVE_DECL_FFLUSH_UNLOCKED
+#undef HAVE_DECL_FGETS_UNLOCKED
+#undef HAVE_DECL_FPUTC_UNLOCKED
+#undef HAVE_DECL_FPUTS_UNLOCKED
+#undef HAVE_DECL_FREAD_UNLOCKED
+#undef HAVE_DECL_FWRITE_UNLOCKED
+#undef HAVE_DECL_GETCHAR_UNLOCKED
+#undef HAVE_DECL_GETC_UNLOCKED
+#undef HAVE_DECL_PUTCHAR_UNLOCKED
+#undef HAVE_DECL_PUTC_UNLOCKED
+
#define PENDING_OUTPUT_N_BYTES 0
diff --git a/contrib/tools/bison/lib/config-win.h b/contrib/tools/bison/lib/config-win.h
index eed2ed434e..c1ca8e81a4 100644
--- a/contrib/tools/bison/lib/config-win.h
+++ b/contrib/tools/bison/lib/config-win.h
@@ -1743,3 +1743,4 @@ enum EWinSdk10ModeBits {
#define PENDING_OUTPUT_N_BYTES (((TWinSdk10File*)fp)->_ptr - ((TWinSdk10File*)fp)->_base)
#define M4_GNU_OPTION "--gnu"
+#define PACKAGE_COPYRIGHT_YEAR 2013
diff --git a/contrib/tools/bison/lib/configmake-linux.h b/contrib/tools/bison/lib/configmake-linux.h
index 510a36f3e8..c72947f530 100644
--- a/contrib/tools/bison/lib/configmake-linux.h
+++ b/contrib/tools/bison/lib/configmake-linux.h
@@ -1,4 +1,27 @@
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
-
-#define LIBDIR "/usr/local/lib"
+#define PREFIX "/var/empty/bison-3.0"
+#define EXEC_PREFIX "/var/empty/bison-3.0"
+#define BINDIR "/var/empty/bison-3.0/bin"
+#define SBINDIR "/var/empty/bison-3.0/sbin"
+#define LIBEXECDIR "/var/empty/bison-3.0/libexec"
+#define DATAROOTDIR "/var/empty/bison-3.0/share"
+#define DATADIR "/var/empty/bison-3.0/share"
+#define SYSCONFDIR "/var/empty/bison-3.0/etc"
+#define SHAREDSTATEDIR "/var/empty/bison-3.0/com"
+#define LOCALSTATEDIR "/var/empty/bison-3.0/var"
+#define INCLUDEDIR "/var/empty/bison-3.0/include"
+#define OLDINCLUDEDIR "/usr/include"
+#define DOCDIR "/var/empty/bison-3.0/share/doc/bison"
+#define INFODIR "/var/empty/bison-3.0/share/info"
+#define HTMLDIR "/var/empty/bison-3.0/share/doc/bison"
+#define DVIDIR "/var/empty/bison-3.0/share/doc/bison"
+#define PDFDIR "/var/empty/bison-3.0/share/doc/bison"
+#define PSDIR "/var/empty/bison-3.0/share/doc/bison"
+#define LIBDIR "/var/empty/bison-3.0/lib"
+#define LISPDIR "/var/empty/bison-3.0/share/emacs/site-lisp"
#define LOCALEDIR "/var/empty/bison-3.0/share/locale"
+#define MANDIR "/var/empty/bison-3.0/share/man"
+#define PKGDATADIR "/var/empty/bison-3.0/share/bison"
+#define PKGINCLUDEDIR "/var/empty/bison-3.0/include/bison"
+#define PKGLIBDIR "/var/empty/bison-3.0/lib/bison"
+#define PKGLIBEXECDIR "/var/empty/bison-3.0/libexec/bison"
diff --git a/contrib/tools/bison/lib/configmake.h b/contrib/tools/bison/lib/configmake.h
index 8a93b4272b..18b15176ab 100644
--- a/contrib/tools/bison/lib/configmake.h
+++ b/contrib/tools/bison/lib/configmake.h
@@ -1,5 +1,7 @@
-#ifdef _MSC_VER
- #include "configmake-win.h"
+#pragma once
+
+#if defined(_MSC_VER)
+# include "configmake-win.h"
#else
- #include "configmake-linux.h"
+# include "configmake-linux.h"
#endif
diff --git a/contrib/tools/bison/lib/error.c b/contrib/tools/bison/lib/error.c
index 3078dd1b51..865b29340b 100644
--- a/contrib/tools/bison/lib/error.c
+++ b/contrib/tools/bison/lib/error.c
@@ -159,10 +159,8 @@ flush_stdout (void)
/* POSIX states that fflush (stdout) after fclose is unspecified; it
is safe in glibc, but not on all other platforms. fflush (NULL)
is always defined, but too draconian. */
-#if !defined(_WIN32) && !defined(_WIN64)
if (0 <= stdout_fd && is_open (stdout_fd))
#endif
-#endif
fflush (stdout);
}
diff --git a/contrib/tools/bison/lib/glthread/lock.c b/contrib/tools/bison/lib/glthread/lock.c
new file mode 100644
index 0000000000..f62aa301fe
--- /dev/null
+++ b/contrib/tools/bison/lib/glthread/lock.c
@@ -0,0 +1,1057 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-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 Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+ gthr-win32.h. */
+
+#include <config.h>
+
+#include "glthread/lock.h"
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+# if !defined PTHREAD_RWLOCK_INITIALIZER
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_rwlock_init (&lock->rwlock, NULL);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_rdlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_rwlock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_rwlock_wrlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_rwlock_unlock (&lock->rwlock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_rwlock_destroy (&lock->rwlock);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->lock, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_readers, NULL);
+ if (err != 0)
+ return err;
+ err = pthread_cond_init (&lock->waiting_writers, NULL);
+ if (err != 0)
+ return err;
+ lock->waiting_writers_count = 0;
+ lock->runcount = 0;
+ return 0;
+}
+
+int
+glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow. */
+ /* POSIX says: "It is implementation-defined whether the calling thread
+ acquires the lock when a writer does not hold the lock and there are
+ writers blocked on the lock." Let's say, no: give the writers a higher
+ priority. */
+ while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ err = pthread_cond_wait (&lock->waiting_readers, &lock->lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ lock->runcount++;
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ /* Test whether no readers or writers are currently running. */
+ while (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ lock->waiting_writers_count++;
+ err = pthread_cond_wait (&lock->waiting_writers, &lock->lock);
+ if (err != 0)
+ {
+ lock->waiting_writers_count--;
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ lock->waiting_writers_count--;
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_lock (&lock->lock);
+ if (err != 0)
+ return err;
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return EINVAL;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers_count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ err = pthread_cond_signal (&lock->waiting_writers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ err = pthread_cond_broadcast (&lock->waiting_readers);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->lock);
+ return err;
+ }
+ }
+ }
+ return pthread_mutex_unlock (&lock->lock);
+}
+
+int
+glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_destroy (&lock->lock);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_readers);
+ if (err != 0)
+ return err;
+ err = pthread_cond_destroy (&lock->waiting_writers);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (lock, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ return 0;
+}
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_mutexattr_t attributes;
+ int err;
+
+ err = pthread_mutexattr_init (&attributes);
+ if (err != 0)
+ return err;
+ err = pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutex_init (&lock->recmutex, &attributes);
+ if (err != 0)
+ {
+ pthread_mutexattr_destroy (&attributes);
+ return err;
+ }
+ err = pthread_mutexattr_destroy (&attributes);
+ if (err != 0)
+ return err;
+ lock->initialized = 1;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->guard);
+ if (err != 0)
+ return err;
+ if (!lock->initialized)
+ {
+ err = glthread_recursive_lock_init_multithreaded (lock);
+ if (err != 0)
+ {
+ pthread_mutex_unlock (&lock->guard);
+ return err;
+ }
+ }
+ err = pthread_mutex_unlock (&lock->guard);
+ if (err != 0)
+ return err;
+ }
+ return pthread_mutex_lock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (!lock->initialized)
+ return EINVAL;
+ return pthread_mutex_unlock (&lock->recmutex);
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ if (!lock->initialized)
+ return EINVAL;
+ err = pthread_mutex_destroy (&lock->recmutex);
+ if (err != 0)
+ return err;
+ lock->initialized = 0;
+ return 0;
+}
+
+# endif
+
+# else
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ err = pthread_mutex_init (&lock->mutex, NULL);
+ if (err != 0)
+ return err;
+ lock->owner = (pthread_t) 0;
+ lock->depth = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ pthread_t self = pthread_self ();
+ if (lock->owner != self)
+ {
+ int err;
+
+ err = pthread_mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
+ lock->owner = self;
+ }
+ if (++(lock->depth) == 0) /* wraparound? */
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != pthread_self ())
+ return EPERM;
+ if (lock->depth == 0)
+ return EINVAL;
+ if (--(lock->depth) == 0)
+ {
+ lock->owner = (pthread_t) 0;
+ return pthread_mutex_unlock (&lock->mutex);
+ }
+ else
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != (pthread_t) 0)
+ return EBUSY;
+ return pthread_mutex_destroy (&lock->mutex);
+}
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+ /* We don't know whether pthread_once_t is an integer type, a floating-point
+ type, a pointer type, or a structure type. */
+ char *firstbyte = (char *)once_control;
+ if (*firstbyte == *(const char *)&fresh_once)
+ {
+ /* First time use of once_control. Invert the first byte. */
+ *firstbyte = ~ *(const char *)&fresh_once;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static void
+glthread_once_call (void *arg)
+{
+ void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
+ void (*initfunction) (void) = *gl_once_temp_addr;
+ initfunction ();
+}
+
+int
+glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
+{
+ void (*temp) (void) = initfunction;
+ return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
+}
+
+int
+glthread_once_singlethreaded (pth_once_t *once_control)
+{
+ /* We know that pth_once_t is an integer type. */
+ if (*once_control == PTH_ONCE_INIT)
+ {
+ /* First time use of once_control. Invert the marker. */
+ *once_control = ~ PTH_ONCE_INIT;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+int
+glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+{
+ int err;
+
+ err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
+ if (err != 0)
+ return err;
+ lock->owner = (thread_t) 0;
+ lock->depth = 0;
+ return 0;
+}
+
+int
+glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
+{
+ thread_t self = thr_self ();
+ if (lock->owner != self)
+ {
+ int err;
+
+ err = mutex_lock (&lock->mutex);
+ if (err != 0)
+ return err;
+ lock->owner = self;
+ }
+ if (++(lock->depth) == 0) /* wraparound? */
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != thr_self ())
+ return EPERM;
+ if (lock->depth == 0)
+ return EINVAL;
+ if (--(lock->depth) == 0)
+ {
+ lock->owner = (thread_t) 0;
+ return mutex_unlock (&lock->mutex);
+ }
+ else
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != (thread_t) 0)
+ return EBUSY;
+ return mutex_destroy (&lock->mutex);
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+int
+glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
+{
+ if (!once_control->inited)
+ {
+ int err;
+
+ /* Use the mutex to guarantee that if another thread is already calling
+ the initfunction, this thread waits until it's finished. */
+ err = mutex_lock (&once_control->mutex);
+ if (err != 0)
+ return err;
+ if (!once_control->inited)
+ {
+ once_control->inited = 1;
+ initfunction ();
+ }
+ return mutex_unlock (&once_control->mutex);
+ }
+ else
+ return 0;
+}
+
+int
+glthread_once_singlethreaded (gl_once_t *once_control)
+{
+ /* We know that gl_once_t contains an integer type. */
+ if (!once_control->inited)
+ {
+ /* First time use of once_control. Invert the marker. */
+ once_control->inited = ~ 0;
+ return 1;
+ }
+ else
+ return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+void
+glthread_lock_init_func (gl_lock_t *lock)
+{
+ InitializeCriticalSection (&lock->lock);
+ lock->guard.done = 1;
+}
+
+int
+glthread_lock_lock_func (gl_lock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_lock_init (lock);
+ else
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ EnterCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glthread_lock_unlock_func (gl_lock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glthread_lock_destroy_func (gl_lock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ DeleteCriticalSection (&lock->lock);
+ lock->guard.done = 0;
+ return 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* In this file, the waitqueues are implemented as circular arrays. */
+#define gl_waitqueue_t gl_carray_waitqueue_t
+
+static void
+gl_waitqueue_init (gl_waitqueue_t *wq)
+{
+ wq->array = NULL;
+ wq->count = 0;
+ wq->alloc = 0;
+ wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+ Returns INVALID_HANDLE_VALUE if an allocation failure occurs. */
+static HANDLE
+gl_waitqueue_add (gl_waitqueue_t *wq)
+{
+ HANDLE event;
+ unsigned int index;
+
+ if (wq->count == wq->alloc)
+ {
+ unsigned int new_alloc = 2 * wq->alloc + 1;
+ HANDLE *new_array =
+ (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+ if (new_array == NULL)
+ /* No more memory. */
+ return INVALID_HANDLE_VALUE;
+ /* Now is a good opportunity to rotate the array so that its contents
+ starts at offset 0. */
+ if (wq->offset > 0)
+ {
+ unsigned int old_count = wq->count;
+ unsigned int old_alloc = wq->alloc;
+ unsigned int old_offset = wq->offset;
+ unsigned int i;
+ if (old_offset + old_count > old_alloc)
+ {
+ unsigned int limit = old_offset + old_count - old_alloc;
+ for (i = 0; i < limit; i++)
+ new_array[old_alloc + i] = new_array[i];
+ }
+ for (i = 0; i < old_count; i++)
+ new_array[i] = new_array[old_offset + i];
+ wq->offset = 0;
+ }
+ wq->array = new_array;
+ wq->alloc = new_alloc;
+ }
+ /* Whether the created event is a manual-reset one or an auto-reset one,
+ does not matter, since we will wait on it only once. */
+ event = CreateEvent (NULL, TRUE, FALSE, NULL);
+ if (event == INVALID_HANDLE_VALUE)
+ /* No way to allocate an event. */
+ return INVALID_HANDLE_VALUE;
+ index = wq->offset + wq->count;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ wq->array[index] = event;
+ wq->count++;
+ return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it. */
+static void
+gl_waitqueue_notify_first (gl_waitqueue_t *wq)
+{
+ SetEvent (wq->array[wq->offset + 0]);
+ wq->offset++;
+ wq->count--;
+ if (wq->count == 0 || wq->offset == wq->alloc)
+ wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all. */
+static void
+gl_waitqueue_notify_all (gl_waitqueue_t *wq)
+{
+ unsigned int i;
+
+ for (i = 0; i < wq->count; i++)
+ {
+ unsigned int index = wq->offset + i;
+ if (index >= wq->alloc)
+ index -= wq->alloc;
+ SetEvent (wq->array[index]);
+ }
+ wq->count = 0;
+ wq->offset = 0;
+}
+
+void
+glthread_rwlock_init_func (gl_rwlock_t *lock)
+{
+ InitializeCriticalSection (&lock->lock);
+ gl_waitqueue_init (&lock->waiting_readers);
+ gl_waitqueue_init (&lock->waiting_writers);
+ lock->runcount = 0;
+ lock->guard.done = 1;
+}
+
+int
+glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_rwlock_init (lock);
+ else
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether only readers are currently running, and whether the runcount
+ field will not overflow. */
+ if (!(lock->runcount + 1 > 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_readers. */
+ HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_readers, incremented lock->runcount. */
+ if (!(lock->runcount > 0))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount + 1 > 0));
+ }
+ }
+ lock->runcount++;
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_rwlock_init (lock);
+ else
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ EnterCriticalSection (&lock->lock);
+ /* Test whether no readers or writers are currently running. */
+ if (!(lock->runcount == 0))
+ {
+ /* This thread has to wait for a while. Enqueue it among the
+ waiting_writers. */
+ HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
+ if (event != INVALID_HANDLE_VALUE)
+ {
+ DWORD result;
+ LeaveCriticalSection (&lock->lock);
+ /* Wait until another thread signals this event. */
+ result = WaitForSingleObject (event, INFINITE);
+ if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+ abort ();
+ CloseHandle (event);
+ /* The thread which signalled the event already did the bookkeeping:
+ removed us from the waiting_writers, set lock->runcount = -1. */
+ if (!(lock->runcount == -1))
+ abort ();
+ return 0;
+ }
+ else
+ {
+ /* Allocation failure. Weird. */
+ do
+ {
+ LeaveCriticalSection (&lock->lock);
+ Sleep (1);
+ EnterCriticalSection (&lock->lock);
+ }
+ while (!(lock->runcount == 0));
+ }
+ }
+ lock->runcount--; /* runcount becomes -1 */
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glthread_rwlock_unlock_func (gl_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ EnterCriticalSection (&lock->lock);
+ if (lock->runcount < 0)
+ {
+ /* Drop a writer lock. */
+ if (!(lock->runcount == -1))
+ abort ();
+ lock->runcount = 0;
+ }
+ else
+ {
+ /* Drop a reader lock. */
+ if (!(lock->runcount > 0))
+ {
+ LeaveCriticalSection (&lock->lock);
+ return EPERM;
+ }
+ lock->runcount--;
+ }
+ if (lock->runcount == 0)
+ {
+ /* POSIX recommends that "write locks shall take precedence over read
+ locks", to avoid "writer starvation". */
+ if (lock->waiting_writers.count > 0)
+ {
+ /* Wake up one of the waiting writers. */
+ lock->runcount--;
+ gl_waitqueue_notify_first (&lock->waiting_writers);
+ }
+ else
+ {
+ /* Wake up all waiting readers. */
+ lock->runcount += lock->waiting_readers.count;
+ gl_waitqueue_notify_all (&lock->waiting_readers);
+ }
+ }
+ LeaveCriticalSection (&lock->lock);
+ return 0;
+}
+
+int
+glthread_rwlock_destroy_func (gl_rwlock_t *lock)
+{
+ if (!lock->guard.done)
+ return EINVAL;
+ if (lock->runcount != 0)
+ return EBUSY;
+ DeleteCriticalSection (&lock->lock);
+ if (lock->waiting_readers.array != NULL)
+ free (lock->waiting_readers.array);
+ if (lock->waiting_writers.array != NULL)
+ free (lock->waiting_writers.array);
+ lock->guard.done = 0;
+ return 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+void
+glthread_recursive_lock_init_func (gl_recursive_lock_t *lock)
+{
+ lock->owner = 0;
+ lock->depth = 0;
+ InitializeCriticalSection (&lock->lock);
+ lock->guard.done = 1;
+}
+
+int
+glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
+{
+ if (!lock->guard.done)
+ {
+ if (InterlockedIncrement (&lock->guard.started) == 0)
+ /* This thread is the first one to need this lock. Initialize it. */
+ glthread_recursive_lock_init (lock);
+ else
+ /* Yield the CPU while waiting for another thread to finish
+ initializing this lock. */
+ while (!lock->guard.done)
+ Sleep (0);
+ }
+ {
+ DWORD self = GetCurrentThreadId ();
+ if (lock->owner != self)
+ {
+ EnterCriticalSection (&lock->lock);
+ lock->owner = self;
+ }
+ if (++(lock->depth) == 0) /* wraparound? */
+ {
+ lock->depth--;
+ return EAGAIN;
+ }
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != GetCurrentThreadId ())
+ return EPERM;
+ if (lock->depth == 0)
+ return EINVAL;
+ if (--(lock->depth) == 0)
+ {
+ lock->owner = 0;
+ LeaveCriticalSection (&lock->lock);
+ }
+ return 0;
+}
+
+int
+glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock)
+{
+ if (lock->owner != 0)
+ return EBUSY;
+ DeleteCriticalSection (&lock->lock);
+ lock->guard.done = 0;
+ return 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+void
+glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
+{
+ if (once_control->inited <= 0)
+ {
+ if (InterlockedIncrement (&once_control->started) == 0)
+ {
+ /* This thread is the first one to come to this once_control. */
+ InitializeCriticalSection (&once_control->lock);
+ EnterCriticalSection (&once_control->lock);
+ once_control->inited = 0;
+ initfunction ();
+ once_control->inited = 1;
+ LeaveCriticalSection (&once_control->lock);
+ }
+ else
+ {
+ /* Undo last operation. */
+ InterlockedDecrement (&once_control->started);
+ /* Some other thread has already started the initialization.
+ Yield the CPU while waiting for the other thread to finish
+ initializing and taking the lock. */
+ while (once_control->inited < 0)
+ Sleep (0);
+ if (once_control->inited <= 0)
+ {
+ /* Take the lock. This blocks until the other thread has
+ finished calling the initfunction. */
+ EnterCriticalSection (&once_control->lock);
+ LeaveCriticalSection (&once_control->lock);
+ if (!(once_control->inited > 0))
+ abort ();
+ }
+ }
+ }
+}
+
+#endif
+
+/* ========================================================================= */
diff --git a/contrib/tools/bison/lib/glthread/lock.h b/contrib/tools/bison/lib/glthread/lock.h
new file mode 100644
index 0000000000..42228df80f
--- /dev/null
+++ b/contrib/tools/bison/lib/glthread/lock.h
@@ -0,0 +1,927 @@
+/* Locking in multithreaded situations.
+ Copyright (C) 2005-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 Bruno Haible <bruno@clisp.org>, 2005.
+ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+ gthr-win32.h. */
+
+/* This file contains locking primitives for use with a given thread library.
+ It does not contain primitives for creating threads or for other
+ synchronization primitives.
+
+ Normal (non-recursive) locks:
+ Type: gl_lock_t
+ Declaration: gl_lock_define(extern, name)
+ Initializer: gl_lock_define_initialized(, name)
+ Initialization: gl_lock_init (name);
+ Taking the lock: gl_lock_lock (name);
+ Releasing the lock: gl_lock_unlock (name);
+ De-initialization: gl_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_lock_init (&name);
+ Taking the lock: err = glthread_lock_lock (&name);
+ Releasing the lock: err = glthread_lock_unlock (&name);
+ De-initialization: err = glthread_lock_destroy (&name);
+
+ Read-Write (non-recursive) locks:
+ Type: gl_rwlock_t
+ Declaration: gl_rwlock_define(extern, name)
+ Initializer: gl_rwlock_define_initialized(, name)
+ Initialization: gl_rwlock_init (name);
+ Taking the lock: gl_rwlock_rdlock (name);
+ gl_rwlock_wrlock (name);
+ Releasing the lock: gl_rwlock_unlock (name);
+ De-initialization: gl_rwlock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_rwlock_init (&name);
+ Taking the lock: err = glthread_rwlock_rdlock (&name);
+ err = glthread_rwlock_wrlock (&name);
+ Releasing the lock: err = glthread_rwlock_unlock (&name);
+ De-initialization: err = glthread_rwlock_destroy (&name);
+
+ Recursive locks:
+ Type: gl_recursive_lock_t
+ Declaration: gl_recursive_lock_define(extern, name)
+ Initializer: gl_recursive_lock_define_initialized(, name)
+ Initialization: gl_recursive_lock_init (name);
+ Taking the lock: gl_recursive_lock_lock (name);
+ Releasing the lock: gl_recursive_lock_unlock (name);
+ De-initialization: gl_recursive_lock_destroy (name);
+ Equivalent functions with control of error handling:
+ Initialization: err = glthread_recursive_lock_init (&name);
+ Taking the lock: err = glthread_recursive_lock_lock (&name);
+ Releasing the lock: err = glthread_recursive_lock_unlock (&name);
+ De-initialization: err = glthread_recursive_lock_destroy (&name);
+
+ Once-only execution:
+ Type: gl_once_t
+ Initializer: gl_once_define(extern, name)
+ Execution: gl_once (name, initfunction);
+ Equivalent functions with control of error handling:
+ Execution: err = glthread_once (&name, initfunction);
+*/
+
+
+#ifndef _LOCK_H
+#define _LOCK_H
+
+#include <errno.h>
+#include <stdlib.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime. */
+# define pthread_in_use() \
+ glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library. */
+
+/* Weak references avoid dragging in external libraries if the other parts
+ of the program don't use them. Here we use them, because we don't want
+ every program that uses libintl to depend on libpthread. This assumes
+ that libpthread would not be loaded after libintl; i.e. if libintl is
+ loaded first, by an executable that does not depend on libpthread, and
+ then a module is dynamically loaded that depends on libpthread, libintl
+ will not be multithread-safe. */
+
+/* The way to test at runtime whether libpthread is present is to test
+ whether a function pointer's value, such as &pthread_mutex_init, is
+ non-NULL. However, some versions of GCC have a bug through which, in
+ PIC mode, &foo != NULL always evaluates to true if there is a direct
+ call to foo(...) in the same function. To avoid this, we test the
+ address of a function in libpthread that we don't use. */
+
+# pragma weak pthread_mutex_init
+# pragma weak pthread_mutex_lock
+# pragma weak pthread_mutex_unlock
+# pragma weak pthread_mutex_destroy
+# pragma weak pthread_rwlock_init
+# pragma weak pthread_rwlock_rdlock
+# pragma weak pthread_rwlock_wrlock
+# pragma weak pthread_rwlock_unlock
+# pragma weak pthread_rwlock_destroy
+# pragma weak pthread_once
+# pragma weak pthread_cond_init
+# pragma weak pthread_cond_wait
+# pragma weak pthread_cond_signal
+# pragma weak pthread_cond_broadcast
+# pragma weak pthread_cond_destroy
+# pragma weak pthread_mutexattr_init
+# pragma weak pthread_mutexattr_settype
+# pragma weak pthread_mutexattr_destroy
+# ifndef pthread_self
+# pragma weak pthread_self
+# endif
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+# pragma weak pthread_cancel
+# define pthread_in_use() (pthread_cancel != NULL)
+# endif
+
+# else
+
+# if !PTHREAD_IN_USE_DETECTION_HARD
+# define pthread_in_use() 1
+# endif
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ PTHREAD_MUTEX_INITIALIZER
+# define glthread_lock_init(LOCK) \
+ (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+# ifdef PTHREAD_RWLOCK_INITIALIZER
+
+typedef pthread_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ PTHREAD_RWLOCK_INITIALIZER
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
+
+# else
+
+typedef struct
+ {
+ int initialized;
+ pthread_mutex_t guard; /* protects the initialization */
+ pthread_rwlock_t rwlock; /* read-write lock */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { 0, PTHREAD_MUTEX_INITIALIZER }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t lock; /* protects the remaining fields */
+ pthread_cond_t waiting_readers; /* waiting readers */
+ pthread_cond_t waiting_writers; /* waiting writers */
+ unsigned int waiting_writers_count; /* number of waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+# define glthread_rwlock_init(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+# if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+typedef pthread_mutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer;
+# ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+# else
+# define gl_recursive_lock_initializer \
+ PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+# endif
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+
+# else
+
+typedef struct
+ {
+ pthread_mutex_t recmutex; /* recursive mutex */
+ pthread_mutex_t guard; /* protects the initialization */
+ int initialized;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+# else
+
+/* Old versions of POSIX threads on Solaris did not have recursive locks.
+ We have to implement them ourselves. */
+
+typedef struct
+ {
+ pthread_mutex_t mutex;
+ pthread_t owner;
+ unsigned long depth;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pthread_in_use () \
+ ? pthread_once (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library. */
+
+# include <pth.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_PTH_THREADS_WEAK
+
+/* Use weak references to the GNU Pth threads library. */
+
+# pragma weak pth_mutex_init
+# pragma weak pth_mutex_acquire
+# pragma weak pth_mutex_release
+# pragma weak pth_rwlock_init
+# pragma weak pth_rwlock_acquire
+# pragma weak pth_rwlock_release
+# pragma weak pth_once
+
+# pragma weak pth_cancel
+# define pth_in_use() (pth_cancel != NULL)
+
+# else
+
+# define pth_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pth_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pth_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ PTH_MUTEX_INIT
+# define glthread_lock_init(LOCK) \
+ (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+# define glthread_lock_lock(LOCK) \
+ (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+# define glthread_lock_unlock(LOCK) \
+ (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+# define glthread_lock_destroy(LOCK) \
+ ((void)(LOCK), 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef pth_rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pth_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ PTH_RWLOCK_INIT
+# define glthread_rwlock_init(LOCK) \
+ (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ ((void)(LOCK), 0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* In Pth, mutexes are recursive by default. */
+typedef pth_mutex_t gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS pth_mutex_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ PTH_MUTEX_INIT
+# define glthread_recursive_lock_init(LOCK) \
+ (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ ((void)(LOCK), 0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pth_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (pth_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void));
+extern int glthread_once_singlethreaded (pth_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library. */
+
+# include <thread.h>
+# error #include <synch.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_SOLARIS_THREADS_WEAK
+
+/* Use weak references to the old Solaris threads library. */
+
+# pragma weak mutex_init
+# pragma weak mutex_lock
+# pragma weak mutex_unlock
+# pragma weak mutex_destroy
+# pragma weak rwlock_init
+# pragma weak rw_rdlock
+# pragma weak rw_wrlock
+# pragma weak rw_unlock
+# pragma weak rwlock_destroy
+# pragma weak thr_self
+
+# pragma weak thr_suspend
+# define thread_in_use() (thr_suspend != NULL)
+
+# else
+
+# define thread_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ DEFAULTMUTEX
+# define glthread_lock_init(LOCK) \
+ (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_lock_lock(LOCK) \
+ (thread_in_use () ? mutex_lock (LOCK) : 0)
+# define glthread_lock_unlock(LOCK) \
+ (thread_in_use () ? mutex_unlock (LOCK) : 0)
+# define glthread_lock_destroy(LOCK) \
+ (thread_in_use () ? mutex_destroy (LOCK) : 0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ DEFAULTRWLOCK
+# define glthread_rwlock_init(LOCK) \
+ (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ (thread_in_use () ? rw_rdlock (LOCK) : 0)
+# define glthread_rwlock_wrlock(LOCK) \
+ (thread_in_use () ? rw_wrlock (LOCK) : 0)
+# define glthread_rwlock_unlock(LOCK) \
+ (thread_in_use () ? rw_unlock (LOCK) : 0)
+# define glthread_rwlock_destroy(LOCK) \
+ (thread_in_use () ? rwlock_destroy (LOCK) : 0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* Old Solaris threads did not have recursive locks.
+ We have to implement them ourselves. */
+
+typedef struct
+ {
+ mutex_t mutex;
+ thread_t owner;
+ unsigned long depth;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { DEFAULTMUTEX, (thread_t) 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_unlock(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
+# define glthread_recursive_lock_destroy(LOCK) \
+ (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
+extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+ {
+ volatile int inited;
+ mutex_t mutex;
+ }
+ gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (thread_in_use () \
+ ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION) \
+ : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
+extern int glthread_once_singlethreaded (gl_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the native Windows Event,
+ Mutex, Semaphore types, because
+ - we need only to synchronize inside a single process (address space),
+ not inter-process locking,
+ - we don't need to support trylock operations. (TryEnterCriticalSection
+ does not work on Windows 95/98/ME. Packages that need trylock usually
+ define their own mutex type.) */
+
+/* There is no way to statically initialize a CRITICAL_SECTION. It needs
+ to be done lazily, once only. For this we need spinlocks. */
+
+typedef struct { volatile int done; volatile long started; } gl_spinlock_t;
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+ {
+ gl_spinlock_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock;
+ }
+ gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+ { { 0, -1 } }
+# define glthread_lock_init(LOCK) \
+ (glthread_lock_init_func (LOCK), 0)
+# define glthread_lock_lock(LOCK) \
+ glthread_lock_lock_func (LOCK)
+# define glthread_lock_unlock(LOCK) \
+ glthread_lock_unlock_func (LOCK)
+# define glthread_lock_destroy(LOCK) \
+ glthread_lock_destroy_func (LOCK)
+extern void glthread_lock_init_func (gl_lock_t *lock);
+extern int glthread_lock_lock_func (gl_lock_t *lock);
+extern int glthread_lock_unlock_func (gl_lock_t *lock);
+extern int glthread_lock_destroy_func (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* It is impossible to implement read-write locks using plain locks, without
+ introducing an extra thread dedicated to managing read-write locks.
+ Therefore here we need to use the low-level Event type. */
+
+typedef struct
+ {
+ HANDLE *array; /* array of waiting threads, each represented by an event */
+ unsigned int count; /* number of waiting threads */
+ unsigned int alloc; /* length of allocated array */
+ unsigned int offset; /* index of first waiting thread in array */
+ }
+ gl_carray_waitqueue_t;
+typedef struct
+ {
+ gl_spinlock_t guard; /* protects the initialization */
+ CRITICAL_SECTION lock; /* protects the remaining fields */
+ gl_carray_waitqueue_t waiting_readers; /* waiting readers */
+ gl_carray_waitqueue_t waiting_writers; /* waiting writers */
+ int runcount; /* number of readers running, or -1 when a writer runs */
+ }
+ gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+ { { 0, -1 } }
+# define glthread_rwlock_init(LOCK) \
+ (glthread_rwlock_init_func (LOCK), 0)
+# define glthread_rwlock_rdlock(LOCK) \
+ glthread_rwlock_rdlock_func (LOCK)
+# define glthread_rwlock_wrlock(LOCK) \
+ glthread_rwlock_wrlock_func (LOCK)
+# define glthread_rwlock_unlock(LOCK) \
+ glthread_rwlock_unlock_func (LOCK)
+# define glthread_rwlock_destroy(LOCK) \
+ glthread_rwlock_destroy_func (LOCK)
+extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* The native Windows documentation says that CRITICAL_SECTION already
+ implements a recursive lock. But we need not rely on it: It's easy to
+ implement a recursive lock without this assumption. */
+
+typedef struct
+ {
+ gl_spinlock_t guard; /* protects the initialization */
+ DWORD owner;
+ unsigned long depth;
+ CRITICAL_SECTION lock;
+ }
+ gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+ STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+ { { 0, -1 }, 0, 0 }
+# define glthread_recursive_lock_init(LOCK) \
+ (glthread_recursive_lock_init_func (LOCK), 0)
+# define glthread_recursive_lock_lock(LOCK) \
+ glthread_recursive_lock_lock_func (LOCK)
+# define glthread_recursive_lock_unlock(LOCK) \
+ glthread_recursive_lock_unlock_func (LOCK)
+# define glthread_recursive_lock_destroy(LOCK) \
+ glthread_recursive_lock_destroy_func (LOCK)
+extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+ {
+ volatile int inited;
+ volatile long started;
+ CRITICAL_SECTION lock;
+ }
+ gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = { -1, -1 };
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (glthread_once_func (ONCE_CONTROL, INITFUNCTION), 0)
+extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void));
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef int gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME)
+# define gl_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_lock_init(NAME) 0
+# define glthread_lock_lock(NAME) 0
+# define glthread_lock_unlock(NAME) 0
+# define glthread_lock_destroy(NAME) 0
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef int gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME)
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
+# define glthread_rwlock_init(NAME) 0
+# define glthread_rwlock_rdlock(NAME) 0
+# define glthread_rwlock_wrlock(NAME) 0
+# define glthread_rwlock_unlock(NAME) 0
+# define glthread_rwlock_destroy(NAME) 0
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef int gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME)
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
+# define glthread_recursive_lock_init(NAME) 0
+# define glthread_recursive_lock_lock(NAME) 0
+# define glthread_recursive_lock_unlock(NAME) 0
+# define glthread_recursive_lock_destroy(NAME) 0
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+ STORAGECLASS gl_once_t NAME = 0;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+ (*(ONCE_CONTROL) == 0 ? (*(ONCE_CONTROL) = ~ 0, INITFUNCTION (), 0) : 0)
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling. */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+#define gl_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+#define gl_rwlock_init(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_rdlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_rdlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_wrlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_wrlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_rwlock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_rwlock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+#define gl_recursive_lock_init(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_init (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_lock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_lock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_unlock(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_unlock (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+#define gl_recursive_lock_destroy(NAME) \
+ do \
+ { \
+ if (glthread_recursive_lock_destroy (&NAME)) \
+ abort (); \
+ } \
+ while (0)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#define gl_once(NAME, INITFUNCTION) \
+ do \
+ { \
+ if (glthread_once (&NAME, INITFUNCTION)) \
+ abort (); \
+ } \
+ while (0)
+
+/* ========================================================================= */
+
+#endif /* _LOCK_H */
diff --git a/contrib/tools/bison/lib/glthread/threadlib.c b/contrib/tools/bison/lib/glthread/threadlib.c
new file mode 100644
index 0000000000..b447657302
--- /dev/null
+++ b/contrib/tools/bison/lib/glthread/threadlib.c
@@ -0,0 +1,73 @@
+/* Multithreading primitives.
+ Copyright (C) 2005-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 Bruno Haible <bruno@clisp.org>, 2005. */
+
+#include <config.h>
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library. */
+
+# include <pthread.h>
+# include <stdlib.h>
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The function to be executed by a dummy thread. */
+static void *
+dummy_thread_func (void *arg)
+{
+ return arg;
+}
+
+int
+glthread_in_use (void)
+{
+ static int tested;
+ static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+ if (!tested)
+ {
+ pthread_t thread;
+
+ if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+ /* Thread creation failed. */
+ result = 0;
+ else
+ {
+ /* Thread creation works. */
+ void *retval;
+ if (pthread_join (thread, &retval) != 0)
+ abort ();
+ result = 1;
+ }
+ tested = 1;
+ }
+ return result;
+}
+
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+/* This declaration is solely to ensure that after preprocessing
+ this file is never empty. */
+typedef int dummy;
diff --git a/contrib/tools/bison/lib/isnanf.c b/contrib/tools/bison/lib/isnanf.c
new file mode 100644
index 0000000000..946cb69ce0
--- /dev/null
+++ b/contrib/tools/bison/lib/isnanf.c
@@ -0,0 +1,20 @@
+/* Test for NaN that does not need libm.
+ 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/>. */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007. */
+
+#define USE_FLOAT
+#include "isnan.c"
diff --git a/contrib/tools/bison/lib/isnanl-nolibm.h b/contrib/tools/bison/lib/isnanl-nolibm.h
index a011374da7..18eb803714 100644
--- a/contrib/tools/bison/lib/isnanl-nolibm.h
+++ b/contrib/tools/bison/lib/isnanl-nolibm.h
@@ -17,7 +17,7 @@
#if HAVE_ISNANL_IN_LIBC
/* Get declaration of isnan macro or (older) isnanl function. */
# include <math.h>
-# if __GNUC__ >= 4 && !__clang__
+# if __GNUC__ >= 4
/* GCC 4.0 and newer provides three built-ins for isnan. */
# undef isnanl
# define isnanl(x) __builtin_isnanl ((long double)(x))
diff --git a/contrib/tools/bison/lib/math.c b/contrib/tools/bison/lib/math.c
new file mode 100644
index 0000000000..ddb2ded530
--- /dev/null
+++ b/contrib/tools/bison/lib/math.c
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_MATH_INLINE _GL_EXTERN_INLINE
+#include "math.h"
diff --git a/contrib/tools/bison/lib/ya.make b/contrib/tools/bison/lib/ya.make
index fe836e8ed7..34dcfae080 100644
--- a/contrib/tools/bison/lib/ya.make
+++ b/contrib/tools/bison/lib/ya.make
@@ -1,39 +1,24 @@
+# Generated by devtools/yamaker.
+
LIBRARY()
-LICENSE(
- BSD-3-Clause AND
- GPL-3.0-or-later
-)
+LICENSE(GPL-3.0-or-later)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-IF (NOT MUSL)
- NO_RUNTIME()
-ENDIF()
-
-NO_COMPILER_WARNINGS()
-
ADDINCL(
- GLOBAL contrib/tools/bison/lib
+ contrib/tools/bison
+ contrib/tools/bison/lib
)
-IF (OS_WINDOWS)
- ADDINCL(
- GLOBAL contrib/tools/bison/lib/platform/win64
- )
-ENDIF()
+NO_COMPILER_WARNINGS()
-IF (NOT OS_WINDOWS)
- CFLAGS(
- GLOBAL -Dregerror=gnu_regerror
- GLOBAL -Dregfree=gnu_regfree
- GLOBAL -Dregexec=gnu_regexec
- )
-ENDIF()
+NO_RUNTIME()
SRCS(
abitset.c
argmatch.c
+ asnprintf.c
basename-lgpl.c
basename.c
binary-io.c
@@ -46,7 +31,6 @@ SRCS(
c-strcasecmp.c
c-strncasecmp.c
cloexec.c
- close.c
close-stream.c
closeout.c
concat-filename.c
@@ -54,25 +38,28 @@ SRCS(
dirname.c
dup-safer-flag.c
dup-safer.c
- dup2.c
ebitset.c
- error.c
exitfail.c
fatal-signal.c
fd-hook.c
fd-safer-flag.c
fd-safer.c
fopen-safer.c
+ fseterr.c
get-errno.c
- getdtablesize.c
+ glthread/lock.c
+ glthread/threadlib.c
hash.c
- isnanl.c
isnand.c
+ isnanf.c
+ isnanl.c
lbitset.c
localcharset.c
+ math.c
mbswidth.c
pipe-safer.c
pipe2-safer.c
+ pipe2.c
printf-args.c
printf-frexp.c
printf-frexpl.c
@@ -84,6 +71,7 @@ SRCS(
stripslash.c
timevar.c
unistd.c
+ uniwidth/width.c
vasnprintf.c
vbitset.c
wait-process.c
@@ -96,50 +84,40 @@ SRCS(
xstrndup.c
)
-IF (NOT MUSL)
- SRCS(
- fseterr.c
- )
-ENDIF()
-
-IF (NOT OS_LINUX)
+IF (OS_DARWIN)
SRCS(
- pipe2.c
+ error.c
+ fpending.c
+ obstack.c
+ obstack_printf.c
strverscmp.c
)
-ENDIF()
-
-IF (OS_WINDOWS)
+ELSEIF (OS_WINDOWS)
+ ADDINCL(
+ GLOBAL contrib/tools/bison/lib/platform/win64
+ )
SRCS(
+ close.c
+ dup2.c
+ error.c
fcntl.c
+ fpending.c
+ getdtablesize.c
getopt.c
getopt1.c
msvc-inval.c
msvc-nothrow.c
+ obstack.c
+ obstack_printf.c
open.c
raise.c
sigaction.c
sigprocmask.c
stpcpy.c
strndup.c
+ strverscmp.c
waitpid.c
wcwidth.c
- uniwidth/width.c
- )
-ENDIF()
-
-IF (NOT OS_LINUX OR MUSL)
- SRCS(
- obstack.c
- obstack_printf.c
- )
-ENDIF()
-
-IF (OS_CYGWIN OR OS_LINUX)
- #not need it
-ELSE()
- SRCS(
- fpending.c
)
ENDIF()
diff --git a/contrib/tools/bison/src/getargs.c b/contrib/tools/bison/src/getargs.c
index adeaf8756d..0edbbd1ed8 100644
--- a/contrib/tools/bison/src/getargs.c
+++ b/contrib/tools/bison/src/getargs.c
@@ -388,7 +388,7 @@ version (void)
fprintf (stdout,
_("Copyright (C) %d Free Software Foundation, Inc.\n"),
- 2013);
+ PACKAGE_COPYRIGHT_YEAR);
fputs (_("\
This is free software; see the source for copying conditions. There is NO\n\
diff --git a/contrib/tools/bison/src/getargs.h b/contrib/tools/bison/src/getargs.h
index 178fb94377..2bf103fcfe 100644
--- a/contrib/tools/bison/src/getargs.h
+++ b/contrib/tools/bison/src/getargs.h
@@ -43,7 +43,6 @@ extern bool yacc_flag; /* for -y */
extern const char *m4_path;
-
/* GLR_PARSER is true if the input file says to use the GLR
(Generalized LR) parser, and to output some additional information
used by the GLR algorithm. */
diff --git a/contrib/tools/bison/src/main.c b/contrib/tools/bison/src/main.c
index f391a9417e..c5200fa937 100644
--- a/contrib/tools/bison/src/main.c
+++ b/contrib/tools/bison/src/main.c
@@ -60,11 +60,6 @@ main (int argc, char *argv[])
{
set_program_name (argv[0]);
setlocale (LC_ALL, "");
-#if 0
- (void) bindtextdomain (PACKAGE, LOCALEDIR);
- (void) bindtextdomain ("bison-runtime", LOCALEDIR);
- (void) textdomain (PACKAGE);
-#endif
{
char const *cp = getenv ("LC_CTYPE");
diff --git a/contrib/tools/bison/src/output.c b/contrib/tools/bison/src/output.c
index b5f098ce54..ede96799b5 100644
--- a/contrib/tools/bison/src/output.c
+++ b/contrib/tools/bison/src/output.c
@@ -46,11 +46,9 @@
#include <contrib/tools/bison/arcadia_root.h>
-#ifndef M4
+#undef M4
#define M4 (m4_path)
-#endif
-#ifndef PKGDATADIR
#define STR(a) XSTR(a)
#define XSTR(a) #a
@@ -62,8 +60,8 @@ default_pkgdatadir()
arc_path = ArcadiaRoot();
return uniqstr_vsprintf("%s/" STR(BISON_DATA_DIR), arc_path);
}
+#undef PKGDATADIR
#define PKGDATADIR (default_pkgdatadir())
-#endif
static struct obstack format_obstack;
diff --git a/contrib/tools/bison/ya.make b/contrib/tools/bison/ya.make
index a7b647cc94..6f8aa959ae 100644
--- a/contrib/tools/bison/ya.make
+++ b/contrib/tools/bison/ya.make
@@ -1,6 +1,6 @@
-PROGRAM()
+# Generated by devtools/yamaker from nixpkgs 22.11.
-VERSION(3.0)
+PROGRAM(bison)
LICENSE(
GPL-3.0-only AND
@@ -8,19 +8,31 @@ LICENSE(
GPL-3.0-or-later WITH Bison-exception-2.2
)
-ORIGINAL_SOURCE(git://git.sv.gnu.org/bison)
-
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-IF (NOT MUSL)
- NO_RUNTIME()
-ENDIF()
+VERSION(3.0)
+
+ORIGINAL_SOURCE(mirror://gnu/bison/bison-3.0.tar.gz)
+
+PEERDIR(
+ contrib/tools/bison/lib
+)
+
+ADDINCL(
+ contrib/tools/bison
+ contrib/tools/bison/lib
+)
NO_COMPILER_WARNINGS()
-ADDINCLSELF()
+NO_RUNTIME()
+
+CFLAGS(
+ -DBISON_DATA_DIR=contrib/tools/bison/data
+)
SRCS(
+ arcadia_root.cpp.in
src/AnnotationList.c
src/InadequacyList.c
src/LR0.c
@@ -57,16 +69,10 @@ SRCS(
src/symtab.c
src/tables.c
src/uniqstr.c
- arcadia_root.cpp.in
)
-CFLAGS(
- -Daccept=bison_accept
- -DBISON_DATA_DIR="contrib/tools/bison/data"
-)
+END()
-PEERDIR(
- contrib/tools/bison/lib
+RECURSE(
+ lib
)
-
-END()