diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-02 20:02:44 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-10-02 20:02:44 +0200 |
commit | 064f9fe191932be96ecfc79fa5accf1eb25142ef (patch) | |
tree | 6e8c824b0dbbde4160dd3e6213127bafe6c738dd /gl | |
parent | 9cd70cbfc4cfc015c10d38b2e356d286b40be416 (diff) | |
download | gnutls-064f9fe191932be96ecfc79fa5accf1eb25142ef.tar.gz |
Updated gnulib and added hash-pjw-bare
Diffstat (limited to 'gl')
-rw-r--r-- | gl/Makefile.am | 14 | ||||
-rw-r--r-- | gl/base64.h | 8 | ||||
-rw-r--r-- | gl/getpass.h | 2 | ||||
-rw-r--r-- | gl/hash-pjw-bare.c | 42 | ||||
-rw-r--r-- | gl/hash-pjw-bare.h | 24 | ||||
-rw-r--r-- | gl/m4/eealloc.m4 | 3 | ||||
-rw-r--r-- | gl/m4/extern-inline.m4 | 57 | ||||
-rw-r--r-- | gl/m4/fcntl-o.m4 | 13 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 5 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 1221 | ||||
-rw-r--r-- | gl/m4/lib-ld.m4 | 58 | ||||
-rw-r--r-- | gl/m4/manywarnings.m4 | 185 | ||||
-rw-r--r-- | gl/m4/timer_time.m4 | 4 | ||||
-rw-r--r-- | gl/m4/timespec.m4 | 8 | ||||
-rw-r--r-- | gl/m4/xsize.m4 | 3 | ||||
-rw-r--r-- | gl/stdbool.in.h | 51 | ||||
-rw-r--r-- | gl/sys_select.in.h | 2 | ||||
-rw-r--r-- | gl/tests/Makefile.am | 2 | ||||
-rw-r--r-- | gl/tests/binary-io.c | 3 | ||||
-rw-r--r-- | gl/tests/binary-io.h | 11 | ||||
-rw-r--r-- | gl/tests/ioctl.c | 2 | ||||
-rw-r--r-- | gl/tests/malloca.h | 2 | ||||
-rw-r--r-- | gl/tests/test-select.h | 6 | ||||
-rw-r--r-- | gl/timespec.c | 3 | ||||
-rw-r--r-- | gl/timespec.h | 13 | ||||
-rw-r--r-- | gl/u64.c | 3 | ||||
-rw-r--r-- | gl/u64.h | 27 | ||||
-rw-r--r-- | gl/verify.h | 6 | ||||
-rw-r--r-- | gl/xsize.c | 3 | ||||
-rw-r--r-- | gl/xsize.h | 17 |
30 files changed, 1027 insertions, 771 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index eb6b6bd8c5..a277b6f692 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime hash-pjw-bare havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings AUTOMAKE_OPTIONS = 1.5 gnits subdir-objects @@ -591,12 +591,18 @@ EXTRA_libgnu_la_SOURCES += gettimeofday.c distclean-local: clean-GNUmakefile clean-GNUmakefile: - test x'$(VPATH)' != x && rm -f $(top_builddir)/GNUmakefile || : + test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile EXTRA_DIST += $(top_srcdir)/GNUmakefile ## end gnulib module gnumakefile +## begin gnulib module hash-pjw-bare + +libgnu_la_SOURCES += hash-pjw-bare.h hash-pjw-bare.c + +## end gnulib module hash-pjw-bare + ## begin gnulib module havelib @@ -2333,6 +2339,7 @@ EXTRA_libgnu_la_SOURCES += time_r.c ## begin gnulib module timespec +libgnu_la_SOURCES += timespec.c EXTRA_DIST += timespec.h @@ -2340,6 +2347,7 @@ EXTRA_DIST += timespec.h ## begin gnulib module u64 +libgnu_la_SOURCES += u64.c EXTRA_DIST += u64.h @@ -2696,7 +2704,7 @@ EXTRA_DIST += wchar.in.h ## begin gnulib module xsize -libgnu_la_SOURCES += xsize.h +libgnu_la_SOURCES += xsize.h xsize.c ## end gnulib module xsize diff --git a/gl/base64.h b/gl/base64.h index dc6f2a4f12..b7e155cf91 100644 --- a/gl/base64.h +++ b/gl/base64.h @@ -24,6 +24,10 @@ /* Get bool. */ # include <stdbool.h> +# ifdef __cplusplus +extern "C" { +# endif + /* This uses that the expression (n+(k-1))/k means the smallest integer >= n/k, i.e., the ceiling of n/k. */ # define BASE64_LENGTH(inlen) ((((inlen) + 2) / 3) * 4) @@ -57,4 +61,8 @@ extern bool base64_decode_alloc_ctx (struct base64_decode_context *ctx, #define base64_decode_alloc(in, inlen, out, outlen) \ base64_decode_alloc_ctx (NULL, in, inlen, out, outlen) +# ifdef __cplusplus +} +# endif + #endif /* BASE64_H */ diff --git a/gl/getpass.h b/gl/getpass.h index 4eabf9dcc6..afe6d2d492 100644 --- a/gl/getpass.h +++ b/gl/getpass.h @@ -21,7 +21,7 @@ /* Get getpass declaration, if available. */ # include <unistd.h> -# if defined HAVE_DECL_GETPASS && !HAVE_DECL_GETPASS +# if !HAVE_DECL_GETPASS /* Read a password of arbitrary length from /dev/tty or stdin. */ char *getpass (const char *prompt); diff --git a/gl/hash-pjw-bare.c b/gl/hash-pjw-bare.c new file mode 100644 index 0000000000..a83cfacbca --- /dev/null +++ b/gl/hash-pjw-bare.c @@ -0,0 +1,42 @@ +/* hash-pjw-bare.c -- compute a hash value from a provided buffer. + + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <config.h> + +#include "hash-pjw-bare.h" + +#include <limits.h> + +#define SIZE_BITS (sizeof (size_t) * CHAR_BIT) + +/* Return a hash of the N bytes of X using the method described by + Bruno Haible in http://www.haible.de/bruno/hashfunc.html. + Note that while many hash functions reduce their result via modulo + to a 0..table_size-1 range, this function does not do that. */ + +size_t +hash_pjw_bare (const void *x, size_t n) +{ + const unsigned char *s = x; + size_t h = 0; + unsigned i; + + for (i = 0; i < n; i++) + h = s[i] + ((h << 9) | (h >> (SIZE_BITS - 9))); + + return h; +} diff --git a/gl/hash-pjw-bare.h b/gl/hash-pjw-bare.h new file mode 100644 index 0000000000..5adbc64319 --- /dev/null +++ b/gl/hash-pjw-bare.h @@ -0,0 +1,24 @@ +/* hash-pjw-bare.h -- declaration for a simple hash function + Copyright (C) 2012 Free Software Foundation, Inc. + + This program is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +#include <stddef.h> + +/* Compute a hash code for a buffer starting at X and of size N, + and return the hash code. Note that unlike hash_pjw(), it does not + return it modulo a table size. + The result is platform dependent: it depends on the size of the 'size_t' + type and on the signedness of the 'char' type. */ +extern size_t hash_pjw_bare (const void *x, size_t n) _GL_ATTRIBUTE_PURE; diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4 index 75f17e2f10..9e5df45d31 100644 --- a/gl/m4/eealloc.m4 +++ b/gl/m4/eealloc.m4 @@ -1,4 +1,4 @@ -# eealloc.m4 serial 2 +# eealloc.m4 serial 3 dnl Copyright (C) 2003, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,7 +8,6 @@ AC_DEFUN([gl_EEALLOC], [ AC_REQUIRE([gl_EEMALLOC]) AC_REQUIRE([gl_EEREALLOC]) - AC_REQUIRE([AC_C_INLINE]) ]) AC_DEFUN([gl_EEMALLOC], diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4 new file mode 100644 index 0000000000..600c8d3fa1 --- /dev/null +++ b/gl/m4/extern-inline.m4 @@ -0,0 +1,57 @@ +dnl 'extern inline' a la ISO C99. + +dnl Copyright 2012 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_EXTERN_INLINE], +[ + AC_REQUIRE([AC_C_INLINE]) + AH_VERBATIM([extern_inline], +[/* _GL_INLINE is a portable alternative to ISO C99 plain 'inline'. + _GL_EXTERN_INLINE is a portable alternative to 'extern inline'. + _GL_INLINE_HEADER_BEGIN contains useful stuff to put + in an include file, before uses of _GL_INLINE. + It suppresses GCC's bogus "no previous prototype for 'FOO'" diagnostic, + when FOO is an inline function in the header; see + <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113>. + _GL_INLINE_HEADER_END contains useful stuff to put + in the same include file, after uses of _GL_INLINE. */ +#if (__GNUC__ \ + ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ + : 199901L <= __STDC_VERSION__) +# define _GL_INLINE inline +# define _GL_EXTERN_INLINE extern inline +#elif 2 < __GNUC__ + (7 <= __GNUC_MINOR__) +# if __GNUC_GNU_INLINE__ + /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ +# define _GL_INLINE extern inline __attribute__ ((__gnu_inline__)) +# else +# define _GL_INLINE extern inline +# endif +# define _GL_EXTERN_INLINE extern +#else +# define _GL_INLINE static inline +# define _GL_EXTERN_INLINE static inline +#endif + +#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) +# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ +# define _GL_INLINE_HEADER_CONST_PRAGMA +# else +# define _GL_INLINE_HEADER_CONST_PRAGMA \ + _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"") +# endif +# define _GL_INLINE_HEADER_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \ + _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \ + _GL_INLINE_HEADER_CONST_PRAGMA +# define _GL_INLINE_HEADER_END \ + _Pragma ("GCC diagnostic pop") +#else +# define _GL_INLINE_HEADER_BEGIN +# define _GL_INLINE_HEADER_END +#endif]) +]) diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4 index 9862741f39..740e78b681 100644 --- a/gl/m4/fcntl-o.m4 +++ b/gl/m4/fcntl-o.m4 @@ -50,7 +50,18 @@ AC_DEFUN([gl_FCNTL_O_FLAGS], #if HAVE_SYMLINK { static char const sym[] = "conftest.sym"; - if (symlink (".", sym) != 0) + if (symlink ("/dev/null", sym) != 0) + result |= 2; + else + { + int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0); + if (fd >= 0) + { + close (fd); + result |= 4; + } + } + if (unlink (sym) != 0 || symlink (".", sym) != 0) result |= 2; else { diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index ee3d1b6261..04f3d46735 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lock-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp base64 bind byteswap c-ctype close connect error extensions func gendocs getaddrinfo getpass getsubopt gettext gettime hash-pjw-bare havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto servent setsockopt shutdown snprintf socket sockets socklen stdint strcase strndup strtok_r strverscmp sys_socket sys_stat time_r timer-time timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) @@ -51,6 +51,7 @@ gl_MODULES([ getsubopt gettext gettime + hash-pjw-bare havelib inet_ntop inet_pton @@ -112,5 +113,5 @@ gl_MAKEFILE_NAME([]) gl_LIBTOOL gl_MACRO_PREFIX([gl]) gl_PO_DOMAIN([]) -gl_WITNESS_C_DOMAIN([]) +gl_WITNESS_C_MACRO([]) gl_VC_FILES([false]) diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index aad1024c14..9b6156211b 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -79,6 +79,7 @@ AC_DEFUN([gl_EARLY], # Code from module error: # Code from module extensions: AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + # Code from module extern-inline: # Code from module fcntl-h: # Code from module fcntl-h-tests: # Code from module fd-hook: @@ -139,6 +140,7 @@ AC_DEFUN([gl_EARLY], # Code from module gettimeofday: # Code from module gettimeofday-tests: # Code from module gnumakefile: + # Code from module hash-pjw-bare: # Code from module havelib: # Code from module hostent: # Code from module ignore-value: @@ -365,484 +367,484 @@ AC_DEFUN([gl_INIT], m4_pushdef([gl_LIBSOURCES_DIR], []) gl_COMMON gl_source_base='gl' -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([accept]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([accept]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([accept]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([accept]) changequote(,)dnl LTALLOCA=`echo "$ALLOCA" | sed -e 's/\.[^.]* /.lo /g;s/\.[^.]*$/.lo/'` changequote([, ])dnl AC_SUBST([LTALLOCA]) -gl_FUNC_ALLOCA -gl_FUNC_ALPHASORT -if test $HAVE_ALPHASORT = 0; then - AC_LIBOBJ([alphasort]) - gl_PREREQ_ALPHASORT -fi -gl_DIRENT_MODULE_INDICATOR([alphasort]) -gl_ARGP -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format]) - AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])]) -gl_HEADER_ARPA_INET -AC_PROG_MKDIR_P -gl_FUNC_BASE64 -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([bind]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([bind]) -gl_BYTESWAP -gl_CLOCK_TIME -gl_FUNC_CLOSE -if test $REPLACE_CLOSE = 1; then - AC_LIBOBJ([close]) -fi -gl_UNISTD_MODULE_INDICATOR([close]) -gl_FUNC_CLOSEDIR -if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then - AC_LIBOBJ([closedir]) -fi -gl_DIRENT_MODULE_INDICATOR([closedir]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([connect]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([connect]) -gl_DIRENT_H -gl_DIRNAME_LGPL -gl_DOUBLE_SLASH_ROOT -gl_HEADER_ERRNO_H -gl_ERROR -if test $ac_cv_lib_error_at_line = no; then - AC_LIBOBJ([error]) - gl_PREREQ_ERROR -fi -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) - AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) -gl_FLOAT_H -if test $REPLACE_FLOAT_LDBL = 1; then - AC_LIBOBJ([float]) -fi -if test $REPLACE_ITOLD = 1; then - AC_LIBOBJ([itold]) -fi -gl_FUNC_FREXP_NO_LIBM -if test $gl_func_frexp_no_libm != yes; then - AC_LIBOBJ([frexp]) -fi -gl_MATH_MODULE_INDICATOR([frexp]) -gl_FUNC_FREXPL_NO_LIBM -if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then - AC_LIBOBJ([frexpl]) -fi -gl_MATH_MODULE_INDICATOR([frexpl]) -gl_FUNC_FSEEK -if test $REPLACE_FSEEK = 1; then - AC_LIBOBJ([fseek]) -fi -gl_STDIO_MODULE_INDICATOR([fseek]) -gl_FUNC_FSEEKO -if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then - AC_LIBOBJ([fseeko]) - gl_PREREQ_FSEEKO -fi -gl_STDIO_MODULE_INDICATOR([fseeko]) -gl_FUNC_FSETERR -if test $ac_cv_func___fseterr = no; then - AC_LIBOBJ([fseterr]) -fi -gl_FUNC_FSTAT -if test $REPLACE_FSTAT = 1; then - AC_LIBOBJ([fstat]) - gl_PREREQ_FSTAT -fi -gl_SYS_STAT_MODULE_INDICATOR([fstat]) -gl_FUNC_FTELL -if test $REPLACE_FTELL = 1; then - AC_LIBOBJ([ftell]) -fi -gl_STDIO_MODULE_INDICATOR([ftell]) -gl_FUNC_FTELLO -if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then - AC_LIBOBJ([ftello]) - gl_PREREQ_FTELLO -fi -gl_STDIO_MODULE_INDICATOR([ftello]) -gl_FUNC -gl_GETADDRINFO -if test $HAVE_GETADDRINFO = 0; then - AC_LIBOBJ([getaddrinfo]) -fi -if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then - AC_LIBOBJ([gai_strerror]) -fi -gl_NETDB_MODULE_INDICATOR([getaddrinfo]) -gl_FUNC_GETDELIM -if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then - AC_LIBOBJ([getdelim]) - gl_PREREQ_GETDELIM -fi -gl_STDIO_MODULE_INDICATOR([getdelim]) -gl_FUNC_GETLINE -if test $REPLACE_GETLINE = 1; then - AC_LIBOBJ([getline]) - gl_PREREQ_GETLINE -fi -gl_STDIO_MODULE_INDICATOR([getline]) -gl_FUNC_GETOPT_GNU -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) -gl_FUNC_GETOPT_POSIX -if test $REPLACE_GETOPT = 1; then - AC_LIBOBJ([getopt]) - AC_LIBOBJ([getopt1]) - gl_PREREQ_GETOPT - dnl Arrange for unistd.h to include getopt.h. - GNULIB_GL_UNISTD_H_GETOPT=1 -fi -AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) -gl_FUNC_GETPASS -if test $HAVE_GETPASS = 0; then - AC_LIBOBJ([getpass]) - gl_PREREQ_GETPASS -fi -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([getpeername]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([getpeername]) -gl_FUNC_GETSUBOPT -if test $HAVE_GETSUBOPT = 0; then - AC_LIBOBJ([getsubopt]) - gl_PREREQ_GETSUBOPT -fi -gl_STDLIB_MODULE_INDICATOR([getsubopt]) -dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. -AM_GNU_GETTEXT_VERSION([0.18.1]) -AC_SUBST([LIBINTL]) -AC_SUBST([LTLIBINTL]) -gl_GETTIME -gl_FUNC_GETTIMEOFDAY -if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then - AC_LIBOBJ([gettimeofday]) - gl_PREREQ_GETTIMEOFDAY -fi -gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) -# Autoconf 2.61a.99 and earlier don't support linking a file only -# in VPATH builds. But since GNUmakefile is for maintainer use -# only, it does not matter if we skip the link with older autoconf. -# Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH -# builds, so use a shell variable to bypass this. -GNUmakefile=GNUmakefile -m4_if(m4_version_compare([2.61a.100], - m4_defn([m4_PACKAGE_VERSION])), [1], [], - [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], - [GNUmakefile=$GNUmakefile])]) -gl_HOSTENT -gl_FUNC_INET_NTOP -if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then - AC_LIBOBJ([inet_ntop]) - gl_PREREQ_INET_NTOP -fi -gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) -gl_FUNC_INET_PTON -if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then - AC_LIBOBJ([inet_pton]) - gl_PREREQ_INET_PTON -fi -gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) -gl_FUNC_ISNAND_NO_LIBM -if test $gl_func_isnand_no_libm != yes; then - AC_LIBOBJ([isnand]) - gl_PREREQ_ISNAND -fi -gl_FUNC_ISNANF_NO_LIBM -if test $gl_func_isnanf_no_libm != yes; then - AC_LIBOBJ([isnanf]) - gl_PREREQ_ISNANF -fi -gl_FUNC_ISNANL_NO_LIBM -if test $gl_func_isnanl_no_libm != yes; then - AC_LIBOBJ([isnanl]) - gl_PREREQ_ISNANL -fi -AC_REQUIRE([gl_LARGEFILE]) -gl_LD_OUTPUT_DEF -gl_LD_VERSION_SCRIPT -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([listen]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([listen]) -gl_FUNC_LSEEK -if test $REPLACE_LSEEK = 1; then - AC_LIBOBJ([lseek]) -fi -gl_UNISTD_MODULE_INDICATOR([lseek]) -AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], - [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) -gl_FUNC_MALLOC_GNU -if test $REPLACE_MALLOC = 1; then - AC_LIBOBJ([malloc]) -fi -gl_MODULE_INDICATOR([malloc-gnu]) -gl_FUNC_MALLOC_POSIX -if test $REPLACE_MALLOC = 1; then - AC_LIBOBJ([malloc]) -fi -gl_STDLIB_MODULE_INDICATOR([malloc-posix]) -gl_MATH_H -gl_FUNC_MEMCHR -if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then - AC_LIBOBJ([memchr]) - gl_PREREQ_MEMCHR -fi -gl_STRING_MODULE_INDICATOR([memchr]) -gl_FUNC_MEMMEM_SIMPLE -if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then - AC_LIBOBJ([memmem]) -fi -gl_STRING_MODULE_INDICATOR([memmem]) -gl_FUNC_MEMPCPY -if test $HAVE_MEMPCPY = 0; then - AC_LIBOBJ([mempcpy]) - gl_PREREQ_MEMPCPY -fi -gl_STRING_MODULE_INDICATOR([mempcpy]) -gl_MINMAX -gl_MSVC_INVAL -if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-inval]) -fi -gl_MSVC_NOTHROW -if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then - AC_LIBOBJ([msvc-nothrow]) -fi -gl_MULTIARCH -gl_HEADER_NETDB -gl_HEADER_NETINET_IN -AC_PROG_MKDIR_P -gl_FUNC_OPENDIR -if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then - AC_LIBOBJ([opendir]) -fi -gl_DIRENT_MODULE_INDICATOR([opendir]) -AC_PATH_PROG([PMCCABE], [pmccabe], [false]) -gl_FUNC_PRINTF_FREXP -gl_FUNC_PRINTF_FREXPL -m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) -AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) -AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) -gl_FUNC_RAWMEMCHR -if test $HAVE_RAWMEMCHR = 0; then - AC_LIBOBJ([rawmemchr]) - gl_PREREQ_RAWMEMCHR -fi -gl_STRING_MODULE_INDICATOR([rawmemchr]) -gl_PREREQ_READ_FILE -gl_FUNC_READDIR -if test $HAVE_READDIR = 0; then - AC_LIBOBJ([readdir]) -fi -gl_DIRENT_MODULE_INDICATOR([readdir]) -gl_FUNC_REALLOC_POSIX -if test $REPLACE_REALLOC = 1; then - AC_LIBOBJ([realloc]) -fi -gl_STDLIB_MODULE_INDICATOR([realloc-posix]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([recv]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([recv]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([recvfrom]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom]) -gl_FUNC_SCANDIR -if test $HAVE_SCANDIR = 0; then - AC_LIBOBJ([scandir]) - gl_PREREQ_SCANDIR -fi -gl_DIRENT_MODULE_INDICATOR([scandir]) -gl_FUNC_SELECT -if test $REPLACE_SELECT = 1; then - AC_LIBOBJ([select]) -fi -gl_SYS_SELECT_MODULE_INDICATOR([select]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([send]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([send]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([sendto]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([sendto]) -gl_SERVENT -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([setsockopt]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([shutdown]) -fi -gl_SYS_SOCKET_MODULE_INDICATOR([shutdown]) -gl_SIGNAL_H -gl_SIGNBIT -if test $REPLACE_SIGNBIT = 1; then - AC_LIBOBJ([signbitf]) - AC_LIBOBJ([signbitd]) - AC_LIBOBJ([signbitl]) -fi -gl_MATH_MODULE_INDICATOR([signbit]) -gl_SIZE_MAX -gl_FUNC_SLEEP -if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then - AC_LIBOBJ([sleep]) -fi -gl_UNISTD_MODULE_INDICATOR([sleep]) -gl_FUNC_SNPRINTF -gl_STDIO_MODULE_INDICATOR([snprintf]) -gl_MODULE_INDICATOR([snprintf]) -AC_REQUIRE([gl_HEADER_SYS_SOCKET]) -if test "$ac_cv_header_winsock2_h" = yes; then - AC_LIBOBJ([socket]) -fi -# When this module is used, sockets may actually occur as file descriptors, -# hence it is worth warning if the modules 'close' and 'ioctl' are not used. -m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) -m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) -AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) -if test "$ac_cv_header_winsock2_h" = yes; then - UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 - SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 -fi -gl_SYS_SOCKET_MODULE_INDICATOR([socket]) -gl_SOCKETLIB -gl_SOCKETS -gl_TYPE_SOCKLEN_T -gt_TYPE_SSIZE_T -gl_STDALIGN_H -gl_STDARG_H -AM_STDBOOL_H -gl_STDDEF_H -gl_STDINT_H -gl_STDIO_H -gl_STDLIB_H -gl_STRCASE -if test $HAVE_STRCASECMP = 0; then - AC_LIBOBJ([strcasecmp]) - gl_PREREQ_STRCASECMP -fi -if test $HAVE_STRNCASECMP = 0; then - AC_LIBOBJ([strncasecmp]) - gl_PREREQ_STRNCASECMP -fi -gl_FUNC_STRCHRNUL -if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then - AC_LIBOBJ([strchrnul]) - gl_PREREQ_STRCHRNUL -fi -gl_STRING_MODULE_INDICATOR([strchrnul]) -gl_FUNC_STRDUP_POSIX -if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then - AC_LIBOBJ([strdup]) - gl_PREREQ_STRDUP -fi -gl_STRING_MODULE_INDICATOR([strdup]) -gl_FUNC_STRERROR -if test $REPLACE_STRERROR = 1; then - AC_LIBOBJ([strerror]) -fi -gl_MODULE_INDICATOR([strerror]) -gl_STRING_MODULE_INDICATOR([strerror]) -AC_REQUIRE([gl_HEADER_ERRNO_H]) -AC_REQUIRE([gl_FUNC_STRERROR_0]) -if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then - AC_LIBOBJ([strerror-override]) - gl_PREREQ_SYS_H_WINSOCK2 -fi -gl_HEADER_STRING_H -gl_HEADER_STRINGS_H -gl_FUNC_STRNDUP -if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then - AC_LIBOBJ([strndup]) -fi -gl_STRING_MODULE_INDICATOR([strndup]) -gl_FUNC_STRNLEN -if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then - AC_LIBOBJ([strnlen]) - gl_PREREQ_STRNLEN -fi -gl_STRING_MODULE_INDICATOR([strnlen]) -gl_FUNC_STRTOK_R -if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then - AC_LIBOBJ([strtok_r]) - gl_PREREQ_STRTOK_R -fi -gl_STRING_MODULE_INDICATOR([strtok_r]) -gl_FUNC_STRVERSCMP -if test $HAVE_STRVERSCMP = 0; then - AC_LIBOBJ([strverscmp]) - gl_PREREQ_STRVERSCMP -fi -gl_STRING_MODULE_INDICATOR([strverscmp]) -gl_HEADER_SYS_SELECT -AC_PROG_MKDIR_P -gl_HEADER_SYS_SOCKET -AC_PROG_MKDIR_P -gl_HEADER_SYS_STAT_H -AC_PROG_MKDIR_P -gl_HEADER_SYS_TIME_H -AC_PROG_MKDIR_P -gl_SYS_TYPES_H -AC_PROG_MKDIR_P -gl_HEADER_SYS_UIO -AC_PROG_MKDIR_P -gl_SYSEXITS -gl_THREADLIB -gl_HEADER_TIME_H -gl_TIME_R -if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then - AC_LIBOBJ([time_r]) - gl_PREREQ_TIME_R -fi -gl_TIME_MODULE_INDICATOR([time_r]) -gl_TIMER_TIME -gl_TIMESPEC -AC_REQUIRE([AC_C_INLINE]) -gl_UNISTD_H -gl_VALGRIND_TESTS -gl_FUNC_VASNPRINTF -gl_FUNC_VASPRINTF -gl_STDIO_MODULE_INDICATOR([vasprintf]) -m4_ifdef([AM_XGETTEXT_OPTION], - [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) - AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) -gl_VERSION_ETC -gl_FUNC_VFPRINTF_POSIX -gl_STDIO_MODULE_INDICATOR([vfprintf-posix]) -gl_FUNC_VPRINTF_POSIX -gl_STDIO_MODULE_INDICATOR([vprintf-posix]) -gl_FUNC_VSNPRINTF -gl_STDIO_MODULE_INDICATOR([vsnprintf]) -gl_WCHAR_H -gl_XSIZE + gl_FUNC_ALLOCA + gl_FUNC_ALPHASORT + if test $HAVE_ALPHASORT = 0; then + AC_LIBOBJ([alphasort]) + gl_PREREQ_ALPHASORT + fi + gl_DIRENT_MODULE_INDICATOR([alphasort]) + gl_ARGP + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=argp_error:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=argp_failure:4:c-format])]) + gl_HEADER_ARPA_INET + AC_PROG_MKDIR_P + gl_FUNC_BASE64 + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([bind]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([bind]) + gl_BYTESWAP + gl_CLOCK_TIME + gl_FUNC_CLOSE + if test $REPLACE_CLOSE = 1; then + AC_LIBOBJ([close]) + fi + gl_UNISTD_MODULE_INDICATOR([close]) + gl_FUNC_CLOSEDIR + if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then + AC_LIBOBJ([closedir]) + fi + gl_DIRENT_MODULE_INDICATOR([closedir]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([connect]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([connect]) + gl_DIRENT_H + gl_DIRNAME_LGPL + gl_DOUBLE_SLASH_ROOT + gl_HEADER_ERRNO_H + gl_ERROR + if test $ac_cv_lib_error_at_line = no; then + AC_LIBOBJ([error]) + gl_PREREQ_ERROR + fi + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) + AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) + AC_REQUIRE([gl_EXTERN_INLINE]) + gl_FLOAT_H + if test $REPLACE_FLOAT_LDBL = 1; then + AC_LIBOBJ([float]) + fi + if test $REPLACE_ITOLD = 1; then + AC_LIBOBJ([itold]) + fi + gl_FUNC_FREXP_NO_LIBM + if test $gl_func_frexp_no_libm != yes; then + AC_LIBOBJ([frexp]) + fi + gl_MATH_MODULE_INDICATOR([frexp]) + gl_FUNC_FREXPL_NO_LIBM + if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then + AC_LIBOBJ([frexpl]) + fi + gl_MATH_MODULE_INDICATOR([frexpl]) + gl_FUNC_FSEEK + if test $REPLACE_FSEEK = 1; then + AC_LIBOBJ([fseek]) + fi + gl_STDIO_MODULE_INDICATOR([fseek]) + gl_FUNC_FSEEKO + if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then + AC_LIBOBJ([fseeko]) + gl_PREREQ_FSEEKO + fi + gl_STDIO_MODULE_INDICATOR([fseeko]) + gl_FUNC_FSETERR + if test $ac_cv_func___fseterr = no; then + AC_LIBOBJ([fseterr]) + fi + gl_FUNC_FSTAT + if test $REPLACE_FSTAT = 1; then + AC_LIBOBJ([fstat]) + gl_PREREQ_FSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([fstat]) + gl_FUNC_FTELL + if test $REPLACE_FTELL = 1; then + AC_LIBOBJ([ftell]) + fi + gl_STDIO_MODULE_INDICATOR([ftell]) + gl_FUNC_FTELLO + if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then + AC_LIBOBJ([ftello]) + gl_PREREQ_FTELLO + fi + gl_STDIO_MODULE_INDICATOR([ftello]) + gl_FUNC + gl_GETADDRINFO + if test $HAVE_GETADDRINFO = 0; then + AC_LIBOBJ([getaddrinfo]) + fi + if test $HAVE_DECL_GAI_STRERROR = 0 || test $REPLACE_GAI_STRERROR = 1; then + AC_LIBOBJ([gai_strerror]) + fi + gl_NETDB_MODULE_INDICATOR([getaddrinfo]) + gl_FUNC_GETDELIM + if test $HAVE_GETDELIM = 0 || test $REPLACE_GETDELIM = 1; then + AC_LIBOBJ([getdelim]) + gl_PREREQ_GETDELIM + fi + gl_STDIO_MODULE_INDICATOR([getdelim]) + gl_FUNC_GETLINE + if test $REPLACE_GETLINE = 1; then + AC_LIBOBJ([getline]) + gl_PREREQ_GETLINE + fi + gl_STDIO_MODULE_INDICATOR([getline]) + gl_FUNC_GETOPT_GNU + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_MODULE_INDICATOR_FOR_TESTS([getopt-gnu]) + gl_FUNC_GETOPT_POSIX + if test $REPLACE_GETOPT = 1; then + AC_LIBOBJ([getopt]) + AC_LIBOBJ([getopt1]) + gl_PREREQ_GETOPT + dnl Arrange for unistd.h to include getopt.h. + GNULIB_GL_UNISTD_H_GETOPT=1 + fi + AC_SUBST([GNULIB_GL_UNISTD_H_GETOPT]) + gl_FUNC_GETPASS + if test $HAVE_GETPASS = 0; then + AC_LIBOBJ([getpass]) + gl_PREREQ_GETPASS + fi + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([getpeername]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([getpeername]) + gl_FUNC_GETSUBOPT + if test $HAVE_GETSUBOPT = 0; then + AC_LIBOBJ([getsubopt]) + gl_PREREQ_GETSUBOPT + fi + gl_STDLIB_MODULE_INDICATOR([getsubopt]) + dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac. + AM_GNU_GETTEXT_VERSION([0.18.1]) + AC_SUBST([LIBINTL]) + AC_SUBST([LTLIBINTL]) + gl_GETTIME + gl_FUNC_GETTIMEOFDAY + if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then + AC_LIBOBJ([gettimeofday]) + gl_PREREQ_GETTIMEOFDAY + fi + gl_SYS_TIME_MODULE_INDICATOR([gettimeofday]) + # Autoconf 2.61a.99 and earlier don't support linking a file only + # in VPATH builds. But since GNUmakefile is for maintainer use + # only, it does not matter if we skip the link with older autoconf. + # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH + # builds, so use a shell variable to bypass this. + GNUmakefile=GNUmakefile + m4_if(m4_version_compare([2.61a.100], + m4_defn([m4_PACKAGE_VERSION])), [1], [], + [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [], + [GNUmakefile=$GNUmakefile])]) + gl_HOSTENT + gl_FUNC_INET_NTOP + if test $HAVE_INET_NTOP = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_ntop]) + gl_PREREQ_INET_NTOP + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_ntop]) + gl_FUNC_INET_PTON + if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_NTOP = 1; then + AC_LIBOBJ([inet_pton]) + gl_PREREQ_INET_PTON + fi + gl_ARPA_INET_MODULE_INDICATOR([inet_pton]) + gl_FUNC_ISNAND_NO_LIBM + if test $gl_func_isnand_no_libm != yes; then + AC_LIBOBJ([isnand]) + gl_PREREQ_ISNAND + fi + gl_FUNC_ISNANF_NO_LIBM + if test $gl_func_isnanf_no_libm != yes; then + AC_LIBOBJ([isnanf]) + gl_PREREQ_ISNANF + fi + gl_FUNC_ISNANL_NO_LIBM + if test $gl_func_isnanl_no_libm != yes; then + AC_LIBOBJ([isnanl]) + gl_PREREQ_ISNANL + fi + AC_REQUIRE([gl_LARGEFILE]) + gl_LD_OUTPUT_DEF + gl_LD_VERSION_SCRIPT + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([listen]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([listen]) + gl_FUNC_LSEEK + if test $REPLACE_LSEEK = 1; then + AC_LIBOBJ([lseek]) + fi + gl_UNISTD_MODULE_INDICATOR([lseek]) + AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER], + [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])]) + gl_FUNC_MALLOC_GNU + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_MODULE_INDICATOR([malloc-gnu]) + gl_FUNC_MALLOC_POSIX + if test $REPLACE_MALLOC = 1; then + AC_LIBOBJ([malloc]) + fi + gl_STDLIB_MODULE_INDICATOR([malloc-posix]) + gl_MATH_H + gl_FUNC_MEMCHR + if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then + AC_LIBOBJ([memchr]) + gl_PREREQ_MEMCHR + fi + gl_STRING_MODULE_INDICATOR([memchr]) + gl_FUNC_MEMMEM_SIMPLE + if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then + AC_LIBOBJ([memmem]) + fi + gl_STRING_MODULE_INDICATOR([memmem]) + gl_FUNC_MEMPCPY + if test $HAVE_MEMPCPY = 0; then + AC_LIBOBJ([mempcpy]) + gl_PREREQ_MEMPCPY + fi + gl_STRING_MODULE_INDICATOR([mempcpy]) + gl_MINMAX + gl_MSVC_INVAL + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-inval]) + fi + gl_MSVC_NOTHROW + if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then + AC_LIBOBJ([msvc-nothrow]) + fi + gl_MULTIARCH + gl_HEADER_NETDB + gl_HEADER_NETINET_IN + AC_PROG_MKDIR_P + gl_FUNC_OPENDIR + if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then + AC_LIBOBJ([opendir]) + fi + gl_DIRENT_MODULE_INDICATOR([opendir]) + AC_PATH_PROG([PMCCABE], [pmccabe], [false]) + gl_FUNC_PRINTF_FREXP + gl_FUNC_PRINTF_FREXPL + m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes]) + AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>]) + AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>]) + gl_FUNC_RAWMEMCHR + if test $HAVE_RAWMEMCHR = 0; then + AC_LIBOBJ([rawmemchr]) + gl_PREREQ_RAWMEMCHR + fi + gl_STRING_MODULE_INDICATOR([rawmemchr]) + gl_PREREQ_READ_FILE + gl_FUNC_READDIR + if test $HAVE_READDIR = 0; then + AC_LIBOBJ([readdir]) + fi + gl_DIRENT_MODULE_INDICATOR([readdir]) + gl_FUNC_REALLOC_POSIX + if test $REPLACE_REALLOC = 1; then + AC_LIBOBJ([realloc]) + fi + gl_STDLIB_MODULE_INDICATOR([realloc-posix]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([recv]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([recv]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([recvfrom]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([recvfrom]) + gl_FUNC_SCANDIR + if test $HAVE_SCANDIR = 0; then + AC_LIBOBJ([scandir]) + gl_PREREQ_SCANDIR + fi + gl_DIRENT_MODULE_INDICATOR([scandir]) + gl_FUNC_SELECT + if test $REPLACE_SELECT = 1; then + AC_LIBOBJ([select]) + fi + gl_SYS_SELECT_MODULE_INDICATOR([select]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([send]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([send]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([sendto]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([sendto]) + gl_SERVENT + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([setsockopt]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([shutdown]) + fi + gl_SYS_SOCKET_MODULE_INDICATOR([shutdown]) + gl_SIGNAL_H + gl_SIGNBIT + if test $REPLACE_SIGNBIT = 1; then + AC_LIBOBJ([signbitf]) + AC_LIBOBJ([signbitd]) + AC_LIBOBJ([signbitl]) + fi + gl_MATH_MODULE_INDICATOR([signbit]) + gl_SIZE_MAX + gl_FUNC_SLEEP + if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then + AC_LIBOBJ([sleep]) + fi + gl_UNISTD_MODULE_INDICATOR([sleep]) + gl_FUNC_SNPRINTF + gl_STDIO_MODULE_INDICATOR([snprintf]) + gl_MODULE_INDICATOR([snprintf]) + AC_REQUIRE([gl_HEADER_SYS_SOCKET]) + if test "$ac_cv_header_winsock2_h" = yes; then + AC_LIBOBJ([socket]) + fi + # When this module is used, sockets may actually occur as file descriptors, + # hence it is worth warning if the modules 'close' and 'ioctl' are not used. + m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])]) + m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])]) + AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2]) + if test "$ac_cv_header_winsock2_h" = yes; then + UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1 + fi + gl_SYS_SOCKET_MODULE_INDICATOR([socket]) + gl_SOCKETLIB + gl_SOCKETS + gl_TYPE_SOCKLEN_T + gt_TYPE_SSIZE_T + gl_STDALIGN_H + gl_STDARG_H + AM_STDBOOL_H + gl_STDDEF_H + gl_STDINT_H + gl_STDIO_H + gl_STDLIB_H + gl_STRCASE + if test $HAVE_STRCASECMP = 0; then + AC_LIBOBJ([strcasecmp]) + gl_PREREQ_STRCASECMP + fi + if test $HAVE_STRNCASECMP = 0; then + AC_LIBOBJ([strncasecmp]) + gl_PREREQ_STRNCASECMP + fi + gl_FUNC_STRCHRNUL + if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then + AC_LIBOBJ([strchrnul]) + gl_PREREQ_STRCHRNUL + fi + gl_STRING_MODULE_INDICATOR([strchrnul]) + gl_FUNC_STRDUP_POSIX + if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then + AC_LIBOBJ([strdup]) + gl_PREREQ_STRDUP + fi + gl_STRING_MODULE_INDICATOR([strdup]) + gl_FUNC_STRERROR + if test $REPLACE_STRERROR = 1; then + AC_LIBOBJ([strerror]) + fi + gl_MODULE_INDICATOR([strerror]) + gl_STRING_MODULE_INDICATOR([strerror]) + AC_REQUIRE([gl_HEADER_ERRNO_H]) + AC_REQUIRE([gl_FUNC_STRERROR_0]) + if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then + AC_LIBOBJ([strerror-override]) + gl_PREREQ_SYS_H_WINSOCK2 + fi + gl_HEADER_STRING_H + gl_HEADER_STRINGS_H + gl_FUNC_STRNDUP + if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then + AC_LIBOBJ([strndup]) + fi + gl_STRING_MODULE_INDICATOR([strndup]) + gl_FUNC_STRNLEN + if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then + AC_LIBOBJ([strnlen]) + gl_PREREQ_STRNLEN + fi + gl_STRING_MODULE_INDICATOR([strnlen]) + gl_FUNC_STRTOK_R + if test $HAVE_STRTOK_R = 0 || test $REPLACE_STRTOK_R = 1; then + AC_LIBOBJ([strtok_r]) + gl_PREREQ_STRTOK_R + fi + gl_STRING_MODULE_INDICATOR([strtok_r]) + gl_FUNC_STRVERSCMP + if test $HAVE_STRVERSCMP = 0; then + AC_LIBOBJ([strverscmp]) + gl_PREREQ_STRVERSCMP + fi + gl_STRING_MODULE_INDICATOR([strverscmp]) + gl_HEADER_SYS_SELECT + AC_PROG_MKDIR_P + gl_HEADER_SYS_SOCKET + AC_PROG_MKDIR_P + gl_HEADER_SYS_STAT_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_TIME_H + AC_PROG_MKDIR_P + gl_SYS_TYPES_H + AC_PROG_MKDIR_P + gl_HEADER_SYS_UIO + AC_PROG_MKDIR_P + gl_SYSEXITS + gl_THREADLIB + gl_HEADER_TIME_H + gl_TIME_R + if test $HAVE_LOCALTIME_R = 0 || test $REPLACE_LOCALTIME_R = 1; then + AC_LIBOBJ([time_r]) + gl_PREREQ_TIME_R + fi + gl_TIME_MODULE_INDICATOR([time_r]) + gl_TIMER_TIME + gl_TIMESPEC + gl_UNISTD_H + gl_VALGRIND_TESTS + gl_FUNC_VASNPRINTF + gl_FUNC_VASPRINTF + gl_STDIO_MODULE_INDICATOR([vasprintf]) + m4_ifdef([AM_XGETTEXT_OPTION], + [AM_][XGETTEXT_OPTION([--flag=asprintf:2:c-format]) + AM_][XGETTEXT_OPTION([--flag=vasprintf:2:c-format])]) + gl_VERSION_ETC + gl_FUNC_VFPRINTF_POSIX + gl_STDIO_MODULE_INDICATOR([vfprintf-posix]) + gl_FUNC_VPRINTF_POSIX + gl_STDIO_MODULE_INDICATOR([vprintf-posix]) + gl_FUNC_VSNPRINTF + gl_STDIO_MODULE_INDICATOR([vsnprintf]) + gl_WCHAR_H + gl_XSIZE # End of code from modules m4_ifval(gl_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ || @@ -889,139 +891,137 @@ changequote([, ])dnl AC_SUBST([gltests_WITNESS]) gl_module_indicator_condition=$gltests_WITNESS m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition]) -AC_REQUIRE([AC_C_INLINE]) -gl_FUNC_DUP2 -if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then - AC_LIBOBJ([dup2]) - gl_PREREQ_DUP2 -fi -gl_UNISTD_MODULE_INDICATOR([dup2]) -gl_ENVIRON -gl_UNISTD_MODULE_INDICATOR([environ]) -gl_FCNTL_H -gl_FUNC_FDOPEN -if test $REPLACE_FDOPEN = 1; then - AC_LIBOBJ([fdopen]) - gl_PREREQ_FDOPEN -fi -gl_STDIO_MODULE_INDICATOR([fdopen]) -gl_FUNC_UNGETC_WORKS -gl_FUNC_UNGETC_WORKS -gl_FUNC_UNGETC_WORKS -gl_FUNC_UNGETC_WORKS -gl_FUNC_FTRUNCATE -if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then - AC_LIBOBJ([ftruncate]) - gl_PREREQ_FTRUNCATE -fi -gl_UNISTD_MODULE_INDICATOR([ftruncate]) -gl_FUNC_GETCWD_LGPL -if test $REPLACE_GETCWD = 1; then - AC_LIBOBJ([getcwd-lgpl]) -fi -gl_UNISTD_MODULE_INDICATOR([getcwd]) -gl_FUNC_GETPAGESIZE -if test $REPLACE_GETPAGESIZE = 1; then - AC_LIBOBJ([getpagesize]) -fi -gl_UNISTD_MODULE_INDICATOR([getpagesize]) -AC_REQUIRE([AC_C_INLINE]) -AC_C_BIGENDIAN -AC_C_BIGENDIAN -gl_INTTYPES_H -gl_INTTYPES_INCOMPLETE -gl_FUNC_IOCTL -if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then - AC_LIBOBJ([ioctl]) -fi -gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) -gl_DOUBLE_EXPONENT_LOCATION -gl_FLOAT_EXPONENT_LOCATION -gl_LONG_DOUBLE_EXPONENT_LOCATION -AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) -gl_LOCK -gl_FUNC_LSTAT -if test $REPLACE_LSTAT = 1; then - AC_LIBOBJ([lstat]) - gl_PREREQ_LSTAT -fi -gl_SYS_STAT_MODULE_INDICATOR([lstat]) -gl_MALLOCA -dnl Check for prerequisites for memory fence checks. -gl_FUNC_MMAP_ANON -AC_CHECK_HEADERS_ONCE([sys/mman.h]) -AC_CHECK_FUNCS_ONCE([mprotect]) -gl_FUNC_OPEN -if test $REPLACE_OPEN = 1; then - AC_LIBOBJ([open]) - gl_PREREQ_OPEN -fi -gl_FCNTL_MODULE_INDICATOR([open]) -gl_PATHMAX -gl_FUNC_PERROR -if test $REPLACE_PERROR = 1; then - AC_LIBOBJ([perror]) -fi -gl_STRING_MODULE_INDICATOR([perror]) -gl_FUNC_PIPE -if test $HAVE_PIPE = 0; then - AC_LIBOBJ([pipe]) -fi -gl_UNISTD_MODULE_INDICATOR([pipe]) -gl_FUNC_PUTENV -if test $REPLACE_PUTENV = 1; then - AC_LIBOBJ([putenv]) -fi -gl_STDLIB_MODULE_INDICATOR([putenv]) -dnl Check for prerequisites for memory fence checks. -gl_FUNC_MMAP_ANON -AC_CHECK_HEADERS_ONCE([sys/mman.h]) -AC_CHECK_FUNCS_ONCE([mprotect]) -AC_CHECK_HEADERS_ONCE([sys/wait.h]) -gl_FUNC_SETENV -if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then - AC_LIBOBJ([setenv]) -fi -gl_STDLIB_MODULE_INDICATOR([setenv]) -AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) -AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) -AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) -AC_CHECK_DECLS_ONCE([alarm]) -gl_FUNC_STAT -if test $REPLACE_STAT = 1; then - AC_LIBOBJ([stat]) - gl_PREREQ_STAT -fi -gl_SYS_STAT_MODULE_INDICATOR([stat]) -gt_TYPE_WCHAR_T -gt_TYPE_WINT_T -gl_FUNC_STRERROR_R -if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then - AC_LIBOBJ([strerror_r]) - gl_PREREQ_STRERROR_R -fi -gl_STRING_MODULE_INDICATOR([strerror_r]) -dnl Check for prerequisites for memory fence checks. -gl_FUNC_MMAP_ANON -AC_CHECK_HEADERS_ONCE([sys/mman.h]) -AC_CHECK_FUNCS_ONCE([mprotect]) -gl_FUNC_SYMLINK -if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then - AC_LIBOBJ([symlink]) -fi -gl_UNISTD_MODULE_INDICATOR([symlink]) -gl_SYS_IOCTL_H -AC_PROG_MKDIR_P -AC_CHECK_FUNCS_ONCE([shutdown]) -gl_FUNC_UNSETENV -if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then - AC_LIBOBJ([unsetenv]) - gl_PREREQ_UNSETENV -fi -gl_STDLIB_MODULE_INDICATOR([unsetenv]) -gl_VALGRIND_TESTS -abs_aux_dir=`cd "$ac_aux_dir"; pwd` -AC_SUBST([abs_aux_dir]) + gl_FUNC_DUP2 + if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then + AC_LIBOBJ([dup2]) + gl_PREREQ_DUP2 + fi + gl_UNISTD_MODULE_INDICATOR([dup2]) + gl_ENVIRON + gl_UNISTD_MODULE_INDICATOR([environ]) + gl_FCNTL_H + gl_FUNC_FDOPEN + if test $REPLACE_FDOPEN = 1; then + AC_LIBOBJ([fdopen]) + gl_PREREQ_FDOPEN + fi + gl_STDIO_MODULE_INDICATOR([fdopen]) + gl_FUNC_UNGETC_WORKS + gl_FUNC_UNGETC_WORKS + gl_FUNC_UNGETC_WORKS + gl_FUNC_UNGETC_WORKS + gl_FUNC_FTRUNCATE + if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then + AC_LIBOBJ([ftruncate]) + gl_PREREQ_FTRUNCATE + fi + gl_UNISTD_MODULE_INDICATOR([ftruncate]) + gl_FUNC_GETCWD_LGPL + if test $REPLACE_GETCWD = 1; then + AC_LIBOBJ([getcwd-lgpl]) + fi + gl_UNISTD_MODULE_INDICATOR([getcwd]) + gl_FUNC_GETPAGESIZE + if test $REPLACE_GETPAGESIZE = 1; then + AC_LIBOBJ([getpagesize]) + fi + gl_UNISTD_MODULE_INDICATOR([getpagesize]) + AC_C_BIGENDIAN + AC_C_BIGENDIAN + gl_INTTYPES_H + gl_INTTYPES_INCOMPLETE + gl_FUNC_IOCTL + if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then + AC_LIBOBJ([ioctl]) + fi + gl_SYS_IOCTL_MODULE_INDICATOR([ioctl]) + gl_DOUBLE_EXPONENT_LOCATION + gl_FLOAT_EXPONENT_LOCATION + gl_LONG_DOUBLE_EXPONENT_LOCATION + AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE]) + gl_LOCK + gl_FUNC_LSTAT + if test $REPLACE_LSTAT = 1; then + AC_LIBOBJ([lstat]) + gl_PREREQ_LSTAT + fi + gl_SYS_STAT_MODULE_INDICATOR([lstat]) + gl_MALLOCA + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_OPEN + if test $REPLACE_OPEN = 1; then + AC_LIBOBJ([open]) + gl_PREREQ_OPEN + fi + gl_FCNTL_MODULE_INDICATOR([open]) + gl_PATHMAX + gl_FUNC_PERROR + if test $REPLACE_PERROR = 1; then + AC_LIBOBJ([perror]) + fi + gl_STRING_MODULE_INDICATOR([perror]) + gl_FUNC_PIPE + if test $HAVE_PIPE = 0; then + AC_LIBOBJ([pipe]) + fi + gl_UNISTD_MODULE_INDICATOR([pipe]) + gl_FUNC_PUTENV + if test $REPLACE_PUTENV = 1; then + AC_LIBOBJ([putenv]) + fi + gl_STDLIB_MODULE_INDICATOR([putenv]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + AC_CHECK_HEADERS_ONCE([sys/wait.h]) + gl_FUNC_SETENV + if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then + AC_LIBOBJ([setenv]) + fi + gl_STDLIB_MODULE_INDICATOR([setenv]) + AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION]) + AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION]) + AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION]) + AC_CHECK_DECLS_ONCE([alarm]) + gl_FUNC_STAT + if test $REPLACE_STAT = 1; then + AC_LIBOBJ([stat]) + gl_PREREQ_STAT + fi + gl_SYS_STAT_MODULE_INDICATOR([stat]) + gt_TYPE_WCHAR_T + gt_TYPE_WINT_T + gl_FUNC_STRERROR_R + if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then + AC_LIBOBJ([strerror_r]) + gl_PREREQ_STRERROR_R + fi + gl_STRING_MODULE_INDICATOR([strerror_r]) + dnl Check for prerequisites for memory fence checks. + gl_FUNC_MMAP_ANON + AC_CHECK_HEADERS_ONCE([sys/mman.h]) + AC_CHECK_FUNCS_ONCE([mprotect]) + gl_FUNC_SYMLINK + if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then + AC_LIBOBJ([symlink]) + fi + gl_UNISTD_MODULE_INDICATOR([symlink]) + gl_SYS_IOCTL_H + AC_PROG_MKDIR_P + AC_CHECK_FUNCS_ONCE([shutdown]) + gl_FUNC_UNSETENV + if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then + AC_LIBOBJ([unsetenv]) + gl_PREREQ_UNSETENV + fi + gl_STDLIB_MODULE_INDICATOR([unsetenv]) + gl_VALGRIND_TESTS + abs_aux_dir=`cd "$ac_aux_dir"; pwd` + AC_SUBST([abs_aux_dir]) m4_popdef([gl_MODULE_INDICATOR_CONDITION]) m4_ifval(gltests_LIBSOURCES_LIST, [ m4_syscmd([test ! -d ]m4_defn([gltests_LIBSOURCES_DIR])[ || @@ -1195,6 +1195,8 @@ AC_DEFUN([gl_FILE_LIST], [ lib/gettime.c lib/gettimeofday.c lib/glthread/threadlib.c + lib/hash-pjw-bare.c + lib/hash-pjw-bare.h lib/inet_ntop.c lib/inet_pton.c lib/intprops.h @@ -1289,7 +1291,9 @@ AC_DEFUN([gl_FILE_LIST], [ lib/sysexits.in.h lib/time.in.h lib/time_r.c + lib/timespec.c lib/timespec.h + lib/u64.c lib/u64.h lib/unistd.in.h lib/vasnprintf.c @@ -1304,6 +1308,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/vsnprintf.c lib/w32sock.h lib/wchar.in.h + lib/xsize.c lib/xsize.h m4/00gnulib.m4 m4/alloca.m4 @@ -1328,6 +1333,7 @@ AC_DEFUN([gl_FILE_LIST], [ m4/exponentf.m4 m4/exponentl.m4 m4/extensions.m4 + m4/extern-inline.m4 m4/fcntl-o.m4 m4/fcntl_h.m4 m4/fdopen.m4 @@ -1654,6 +1660,7 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-vsnprintf.c tests/test-wchar.c tests/zerosize-ptr.h + tests=lib/binary-io.c tests=lib/binary-io.h tests=lib/dup2.c tests=lib/fcntl.in.h diff --git a/gl/m4/lib-ld.m4 b/gl/m4/lib-ld.m4 index 4e1374d9bc..e1feab5405 100644 --- a/gl/m4/lib-ld.m4 +++ b/gl/m4/lib-ld.m4 @@ -1,33 +1,39 @@ -# lib-ld.m4 serial 5 (gettext-0.18.2) +# lib-ld.m4 serial 6 dnl Copyright (C) 1996-2003, 2009-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, -dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision -dnl with libtool.m4. +dnl with replacements s/_*LT_PATH/AC_LIB_PROG/ and s/lt_/acl_/ to avoid +dnl collision with libtool.m4. -dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +dnl From libtool-2.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], [acl_cv_prog_gnu_ld], -[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +[# I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - acl_cv_prog_gnu_ld=yes ;; + acl_cv_prog_gnu_ld=yes + ;; *) - acl_cv_prog_gnu_ld=no ;; + acl_cv_prog_gnu_ld=no + ;; esac]) with_gnu_ld=$acl_cv_prog_gnu_ld ]) -dnl From libtool-1.4. Sets the variable LD. +dnl From libtool-2.4. Sets the variable LD. AC_DEFUN([AC_LIB_PROG_LD], -[AC_ARG_WITH([gnu-ld], -[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], -test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) -AC_REQUIRE([AC_PROG_CC])dnl +[AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld [default=no]])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then @@ -40,10 +46,11 @@ if test "${PATH_SEPARATOR+set}" != set; then || PATH_SEPARATOR=';' } fi + ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by GCC]) + AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw @@ -53,11 +60,11 @@ if test "$GCC" = yes; then esac case $ac_prog in # Accept absolute paths. - [[\\/]* | [A-Za-z]:[\\/]*)] - [re_direlt='/[^/][^/]*/\.\./'] - # Canonicalize the path of ld - ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'` + while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" @@ -78,23 +85,26 @@ else fi AC_CACHE_VAL([acl_cv_path_LD], [if test -z "$LD"; then - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do + IFS="$acl_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some GNU ld's only accept -v. + # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in + case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in *GNU* | *'with BFD'*) - test "$with_gnu_ld" != no && break ;; + test "$with_gnu_ld" != no && break + ;; *) - test "$with_gnu_ld" != yes && break ;; + test "$with_gnu_ld" != yes && break + ;; esac fi done - IFS="$ac_save_ifs" + IFS="$acl_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) diff --git a/gl/m4/manywarnings.m4 b/gl/m4/manywarnings.m4 index 864fc85198..f3cb23be1c 100644 --- a/gl/m4/manywarnings.m4 +++ b/gl/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 4 +# manywarnings.m4 serial 5 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -35,14 +35,12 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT], # make sure your gcc understands it. AC_DEFUN([gl_MANYWARN_ALL_GCC], [ - dnl First, check if -Wno-missing-field-initializers is needed. - dnl -Wmissing-field-initializers is implied by -W, but that issues - dnl warnings with GCC version before 4.7, for the common idiom - dnl of initializing types on the stack to zero, using { 0, } + dnl First, check for some issues that only occur when combining multiple + dnl gcc warning categories. AC_REQUIRE([AC_PROG_CC]) if test -n "$GCC"; then - dnl First, check -W -Werror -Wno-missing-field-initializers is supported + dnl Check if -W -Werror -Wno-missing-field-initializers is supported dnl with the current $CC $CFLAGS $CPPFLAGS. AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported]) AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [ @@ -77,107 +75,150 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC], ]) AC_MSG_RESULT([$gl_cv_cc_nomfi_needed]) fi + + dnl Next, check if -Werror -Wuninitialized is useful with the + dnl user's choice of $CFLAGS; some versions of gcc warn that it + dnl has no effect if -O is not also used + AC_MSG_CHECKING([whether -Wuninitialized is supported]) + AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [ + gl_save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror -Wuninitialized" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[]], [[]])], + [gl_cv_cc_uninitialized_supported=yes], + [gl_cv_cc_uninitialized_supported=no]) + CFLAGS="$gl_save_CFLAGS"]) + AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported]) + fi + # List all gcc warning categories. gl_manywarn_set= for gl_manywarn_item in \ - -Wall \ -W \ - -Wformat-y2k \ - -Wformat-nonliteral \ - -Wformat-security \ - -Winit-self \ - -Wmissing-include-dirs \ - -Wswitch-default \ - -Wswitch-enum \ - -Wunused \ - -Wunknown-pragmas \ - -Wstrict-aliasing \ - -Wstrict-overflow \ - -Wsystem-headers \ - -Wfloat-equal \ - -Wtraditional \ - -Wtraditional-conversion \ - -Wdeclaration-after-statement \ - -Wundef \ - -Wshadow \ - -Wunsafe-loop-optimizations \ - -Wpointer-arith \ + -Wabi \ + -Waddress \ + -Wall \ + -Warray-bounds \ + -Wattributes \ -Wbad-function-cast \ - -Wc++-compat \ - -Wcast-qual \ - -Wcast-align \ - -Wwrite-strings \ - -Wconversion \ - -Wsign-conversion \ - -Wlogical-op \ - -Waggregate-return \ - -Wstrict-prototypes \ - -Wold-style-definition \ - -Wmissing-prototypes \ - -Wmissing-declarations \ - -Wmissing-noreturn \ - -Wmissing-format-attribute \ - -Wpacked \ - -Wpadded \ - -Wredundant-decls \ - -Wnested-externs \ - -Wunreachable-code \ - -Winline \ - -Winvalid-pch \ - -Wlong-long \ - -Wvla \ - -Wvolatile-register-var \ - -Wdisabled-optimization \ - -Wstack-protector \ - -Woverlength-strings \ -Wbuiltin-macro-redefined \ - -Wmudflap \ - -Wpacked-bitfield-compat \ - -Wsync-nand \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # The following are not documented in the manual but are included in - # output from gcc --help=warnings. - for gl_manywarn_item in \ - -Wattributes \ + -Wcast-align \ + -Wchar-subscripts \ + -Wclobbered \ + -Wcomment \ + -Wcomments \ -Wcoverage-mismatch \ - -Wunused-macros \ - ; do - gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" - done - # More warnings from gcc 4.6.2 --help=warnings. - for gl_manywarn_item in \ - -Wabi \ -Wcpp \ -Wdeprecated \ -Wdeprecated-declarations \ + -Wdisabled-optimization \ -Wdiv-by-zero \ -Wdouble-promotion \ + -Wempty-body \ -Wendif-labels \ + -Wenum-compare \ -Wextra \ -Wformat-contains-nul \ -Wformat-extra-args \ + -Wformat-nonliteral \ + -Wformat-security \ + -Wformat-y2k \ -Wformat-zero-length \ -Wformat=2 \ + -Wfree-nonheap-object \ + -Wignored-qualifiers \ + -Wimplicit \ + -Wimplicit-function-declaration \ + -Wimplicit-int \ + -Winit-self \ + -Winline \ + -Wint-to-pointer-cast \ + -Winvalid-memory-model \ + -Winvalid-pch \ + -Wjump-misses-init \ + -Wlogical-op \ + -Wmain \ + -Wmaybe-uninitialized \ + -Wmissing-braces \ + -Wmissing-declarations \ + -Wmissing-field-initializers \ + -Wmissing-format-attribute \ + -Wmissing-include-dirs \ + -Wmissing-noreturn \ + -Wmissing-parameter-type \ + -Wmissing-prototypes \ + -Wmudflap \ -Wmultichar \ + -Wnarrowing \ + -Wnested-externs \ + -Wnonnull \ -Wnormalized=nfc \ + -Wold-style-declaration \ + -Wold-style-definition \ -Woverflow \ + -Woverlength-strings \ + -Woverride-init \ + -Wpacked \ + -Wpacked-bitfield-compat \ + -Wparentheses \ + -Wpointer-arith \ + -Wpointer-sign \ -Wpointer-to-int-cast \ -Wpragmas \ + -Wreturn-type \ + -Wsequence-point \ + -Wshadow \ + -Wsizeof-pointer-memaccess \ + -Wstack-protector \ + -Wstrict-aliasing \ + -Wstrict-overflow \ + -Wstrict-prototypes \ -Wsuggest-attribute=const \ + -Wsuggest-attribute=format \ -Wsuggest-attribute=noreturn \ -Wsuggest-attribute=pure \ + -Wswitch \ + -Wswitch-default \ + -Wsync-nand \ + -Wsystem-headers \ -Wtrampolines \ + -Wtrigraphs \ + -Wtype-limits \ + -Wuninitialized \ + -Wunknown-pragmas \ + -Wunreachable-code \ + -Wunsafe-loop-optimizations \ + -Wunused \ + -Wunused-but-set-parameter \ + -Wunused-but-set-variable \ + -Wunused-function \ + -Wunused-label \ + -Wunused-local-typedefs \ + -Wunused-macros \ + -Wunused-parameter \ + -Wunused-result \ + -Wunused-value \ + -Wunused-variable \ + -Wvarargs \ + -Wvariadic-macros \ + -Wvector-operation-performance \ + -Wvla \ + -Wvolatile-register-var \ + -Wwrite-strings \ + \ ; do gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item" done - # Disable the missing-field-initializers warning if needed + # Disable specific options as needed. if test "$gl_cv_cc_nomfi_needed" = yes; then gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers" fi + if test "$gl_cv_cc_uninitialized_supported" = no; then + gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized" + fi + $1=$gl_manywarn_set ]) diff --git a/gl/m4/timer_time.m4 b/gl/m4/timer_time.m4 index d6e0efeb61..bc84554b78 100644 --- a/gl/m4/timer_time.m4 +++ b/gl/m4/timer_time.m4 @@ -1,4 +1,4 @@ -# timer_time.m4 serial 1 +# timer_time.m4 serial 2 dnl Copyright (C) 2011-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -33,7 +33,7 @@ AC_DEFUN([gl_TIMER_TIME], #endif #endif ], - [LIB_TIMER_TIME="$LIBMULTITHREAD $LIB_TIMER_TIME"]) + [LIB_TIMER_TIME="$LIB_TIMER_TIME $LIBMULTITHREAD"]) AC_CHECK_FUNCS([timer_settime]) LIBS=$gl_saved_libs ]) diff --git a/gl/m4/timespec.m4 b/gl/m4/timespec.m4 index 597b9c2d1a..63c00e83cd 100644 --- a/gl/m4/timespec.m4 +++ b/gl/m4/timespec.m4 @@ -1,4 +1,4 @@ -#serial 14 +#serial 15 # Copyright (C) 2000-2001, 2003-2007, 2009-2012 Free Software Foundation, Inc. @@ -8,8 +8,4 @@ dnl From Jim Meyering -AC_DEFUN([gl_TIMESPEC], -[ - dnl Prerequisites of lib/timespec.h. - AC_REQUIRE([AC_C_INLINE]) -]) +AC_DEFUN([gl_TIMESPEC], [:]) diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4 index b3b7feebfa..d85a5f10f8 100644 --- a/gl/m4/xsize.m4 +++ b/gl/m4/xsize.m4 @@ -1,4 +1,4 @@ -# xsize.m4 serial 4 +# xsize.m4 serial 5 dnl Copyright (C) 2003-2004, 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,5 @@ AC_DEFUN([gl_XSIZE], [ dnl Prerequisites of lib/xsize.h. AC_REQUIRE([gl_SIZE_MAX]) - AC_REQUIRE([AC_C_INLINE]) AC_CHECK_HEADERS([stdint.h]) ]) diff --git a/gl/stdbool.in.h b/gl/stdbool.in.h index ed1f9aa488..1f8caee4f2 100644 --- a/gl/stdbool.in.h +++ b/gl/stdbool.in.h @@ -66,24 +66,19 @@ # undef true #endif -/* For the sake of symbolic names in gdb, we define true and false as - enum constants, not only as macros. - It is tempting to write - typedef enum { false = 0, true = 1 } _Bool; - so that gdb prints values of type 'bool' symbolically. But if we do - this, values of type '_Bool' may promote to 'int' or 'unsigned int' - (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' - (see ISO C 99 6.3.1.1.(2)). So we add a negative value to the - enum; this ensures that '_Bool' promotes to 'int'. */ -#if defined __cplusplus || (defined __BEOS__ && !defined __HAIKU__) +#ifdef __cplusplus +# define _Bool bool +# define bool bool +#else +# if defined __BEOS__ && !defined __HAIKU__ /* A compiler known to have 'bool'. */ /* If the compiler already has both 'bool' and '_Bool', we can assume they are the same types. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ typedef bool _Bool; -# endif -#else -# if !defined __GNUC__ +# endif +# else +# if !defined __GNUC__ /* If @HAVE__BOOL@: Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when the built-in _Bool type is used. See @@ -103,19 +98,35 @@ typedef bool _Bool; "Invalid enumerator. (badenum)" with HP-UX cc on Tru64. The only benefit of the enum, debuggability, is not important with these compilers. So use 'signed char' and no enum. */ -# define _Bool signed char -# else +# define _Bool signed char +# else /* With this compiler, trust the _Bool type if the compiler has it. */ -# if !@HAVE__BOOL@ +# if !@HAVE__BOOL@ + /* For the sake of symbolic names in gdb, define true and false as + enum constants, not only as macros. + It is tempting to write + typedef enum { false = 0, true = 1 } _Bool; + so that gdb prints values of type 'bool' symbolically. But then + values of type '_Bool' might promote to 'int' or 'unsigned int' + (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int' + (see ISO C 99 6.3.1.1.(2)). So add a negative value to the + enum; this ensures that '_Bool' promotes to 'int'. */ typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool; +# endif # endif # endif +# define bool _Bool #endif -#define bool _Bool /* The other macros must be usable in preprocessor directives. */ -#define false 0 -#define true 1 +#ifdef __cplusplus +# define false false +# define true true +#else +# define false 0 +# define true 1 +#endif + #define __bool_true_false_are_defined 1 #endif /* _GL_STDBOOL_H */ diff --git a/gl/sys_select.in.h b/gl/sys_select.in.h index 0aee2a16cb..ae8f90cae7 100644 --- a/gl/sys_select.in.h +++ b/gl/sys_select.in.h @@ -130,7 +130,7 @@ /* Re-define FD_ISSET to avoid a WSA call while we are not using network sockets. */ -static inline int +static int rpl_fd_isset (SOCKET fd, fd_set * set) { u_int i; diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am index f73d26b408..5a74e77a73 100644 --- a/gl/tests/Makefile.am +++ b/gl/tests/Makefile.am @@ -103,7 +103,7 @@ EXTRA_DIST += test-base64.c macros.h ## begin gnulib module binary-io -libtests_a_SOURCES += binary-io.h +libtests_a_SOURCES += binary-io.h binary-io.c ## end gnulib module binary-io diff --git a/gl/tests/binary-io.c b/gl/tests/binary-io.c new file mode 100644 index 0000000000..8bbdb44d12 --- /dev/null +++ b/gl/tests/binary-io.c @@ -0,0 +1,3 @@ +#include <config.h> +#define BINARY_IO_INLINE _GL_EXTERN_INLINE +#include "binary-io.h" diff --git a/gl/tests/binary-io.h b/gl/tests/binary-io.h index a33e32aee2..0f376e3893 100644 --- a/gl/tests/binary-io.h +++ b/gl/tests/binary-io.h @@ -25,6 +25,11 @@ so we include it here first. */ #include <stdio.h> +_GL_INLINE_HEADER_BEGIN +#ifndef BINARY_IO_INLINE +# define BINARY_IO_INLINE _GL_INLINE +#endif + /* set_binary_mode (fd, mode) sets the binary/text I/O mode of file descriptor fd to the given mode (must be O_BINARY or O_TEXT) and returns the previous mode. */ @@ -39,9 +44,9 @@ # endif #else /* On reasonable systems, binary I/O is the only choice. */ - /* Use an inline function rather than a macro, to avoid gcc warnings + /* Use a function rather than a macro, to avoid gcc warnings "warning: statement with no effect". */ -static inline int +BINARY_IO_INLINE int set_binary_mode (int fd, int mode) { (void) fd; @@ -62,4 +67,6 @@ set_binary_mode (int fd, int mode) # define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY)) #endif +_GL_INLINE_HEADER_END + #endif /* _BINARY_H */ diff --git a/gl/tests/ioctl.c b/gl/tests/ioctl.c index aa5df602c0..4a2fd3981f 100644 --- a/gl/tests/ioctl.c +++ b/gl/tests/ioctl.c @@ -53,8 +53,6 @@ rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */) # include "fd-hook.h" /* Get _get_osfhandle. */ # include "msvc-nothrow.h" -/* Get HANDLE */ -# include <windows.h> static int primary_ioctl (int fd, int request, void *arg) diff --git a/gl/tests/malloca.h b/gl/tests/malloca.h index 0cedf5f633..f06e9e7b46 100644 --- a/gl/tests/malloca.h +++ b/gl/tests/malloca.h @@ -42,7 +42,7 @@ extern "C" { and a page size can be as small as 4096 bytes. So we cannot safely allocate anything larger than 4096 bytes. Also care for the possibility of a few compiler-allocated temporary stack slots. - This must be a macro, not an inline function. */ + This must be a macro, not a function. */ # define safe_alloca(N) ((N) < 4032 ? alloca (N) : NULL) #else # define safe_alloca(N) ((void) (N), NULL) diff --git a/gl/tests/test-select.h b/gl/tests/test-select.h index 1169e59290..af0e38cf09 100644 --- a/gl/tests/test-select.h +++ b/gl/tests/test-select.h @@ -84,6 +84,9 @@ open_server_socket (void) s = socket (AF_INET, SOCK_STREAM, 0); + x = 1; + setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); + memset (&ia, 0, sizeof (ia)); ia.sin_family = AF_INET; inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr); @@ -94,9 +97,6 @@ open_server_socket (void) exit (77); } - x = 1; - setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x)); - if (listen (s, 1) < 0) { perror ("listen"); diff --git a/gl/timespec.c b/gl/timespec.c new file mode 100644 index 0000000000..2b6098ed7b --- /dev/null +++ b/gl/timespec.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_TIMESPEC_INLINE _GL_EXTERN_INLINE +#include "timespec.h" diff --git a/gl/timespec.h b/gl/timespec.h index a58707947c..d0a2194f61 100644 --- a/gl/timespec.h +++ b/gl/timespec.h @@ -21,6 +21,11 @@ # include <time.h> +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_TIMESPEC_INLINE +# define _GL_TIMESPEC_INLINE _GL_INLINE +#endif + /* Return negative, zero, positive if A < B, A == B, A > B, respectively. For each time stamp T, this code assumes that either: @@ -49,7 +54,7 @@ The (int) cast avoids a gcc -Wconversion warning. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 @@ -59,7 +64,7 @@ timespec_cmp (struct timespec a, struct timespec b) /* Return -1, 0, 1, depending on the sign of A. A.tv_nsec must be nonnegative. */ -static inline int +_GL_TIMESPEC_INLINE int timespec_sign (struct timespec a) { return a.tv_sec < 0 ? -1 : a.tv_sec || a.tv_nsec; @@ -73,7 +78,7 @@ struct timespec dtotimespec (double) _GL_ATTRIBUTE_CONST; /* Return an approximation to A, of type 'double'. */ -static inline double +_GL_TIMESPEC_INLINE double timespectod (struct timespec a) { return a.tv_sec + a.tv_nsec / 1e9; @@ -82,4 +87,6 @@ timespectod (struct timespec a) void gettime (struct timespec *); int settime (struct timespec const *); +_GL_INLINE_HEADER_END + #endif diff --git a/gl/u64.c b/gl/u64.c new file mode 100644 index 0000000000..04cf7a2994 --- /dev/null +++ b/gl/u64.c @@ -0,0 +1,3 @@ +#include <config.h> +#define _GL_U64_INLINE _GL_EXTERN_INLINE +#include "u64.h" @@ -19,6 +19,11 @@ #include <stdint.h> +_GL_INLINE_HEADER_BEGIN +#ifndef _GL_U64_INLINE +# define _GL_U64_INLINE _GL_INLINE +#endif + /* Return X rotated left by N bits, where 0 < N < 64. */ #define u64rol(x, n) u64or (u64shl (x, n), u64shr (x, 64 - n)) @@ -54,7 +59,7 @@ typedef struct { uint32_t lo, hi; } u64; /* Given the high and low-order 32-bit quantities HI and LO, return a u64 value representing (HI << 32) + LO. */ -static inline u64 +_GL_U64_INLINE u64 u64hilo (uint32_t hi, uint32_t lo) { u64 r; @@ -64,7 +69,7 @@ u64hilo (uint32_t hi, uint32_t lo) } /* Return a u64 value representing LO. */ -static inline u64 +_GL_U64_INLINE u64 u64lo (uint32_t lo) { u64 r; @@ -74,7 +79,7 @@ u64lo (uint32_t lo) } /* Return a u64 value representing SIZE. */ -static inline u64 +_GL_U64_INLINE u64 u64size (size_t size) { u64 r; @@ -84,14 +89,14 @@ u64size (size_t size) } /* Return X < Y. */ -static inline int +_GL_U64_INLINE int u64lt (u64 x, u64 y) { return x.hi < y.hi || (x.hi == y.hi && x.lo < y.lo); } /* Return X & Y. */ -static inline u64 +_GL_U64_INLINE u64 u64and (u64 x, u64 y) { u64 r; @@ -101,7 +106,7 @@ u64and (u64 x, u64 y) } /* Return X | Y. */ -static inline u64 +_GL_U64_INLINE u64 u64or (u64 x, u64 y) { u64 r; @@ -111,7 +116,7 @@ u64or (u64 x, u64 y) } /* Return X ^ Y. */ -static inline u64 +_GL_U64_INLINE u64 u64xor (u64 x, u64 y) { u64 r; @@ -121,7 +126,7 @@ u64xor (u64 x, u64 y) } /* Return X + Y. */ -static inline u64 +_GL_U64_INLINE u64 u64plus (u64 x, u64 y) { u64 r; @@ -131,7 +136,7 @@ u64plus (u64 x, u64 y) } /* Return X << N. */ -static inline u64 +_GL_U64_INLINE u64 u64shl (u64 x, int n) { u64 r; @@ -149,7 +154,7 @@ u64shl (u64 x, int n) } /* Return X >> N. */ -static inline u64 +_GL_U64_INLINE u64 u64shr (u64 x, int n) { u64 r; @@ -167,3 +172,5 @@ u64shr (u64 x, int n) } #endif + +_GL_INLINE_HEADER_END diff --git a/gl/verify.h b/gl/verify.h index cef14ad157..0c320b19ad 100644 --- a/gl/verify.h +++ b/gl/verify.h @@ -125,7 +125,7 @@ extern int (*dummy (void)) [sizeof (struct {...})]; * GCC warns about duplicate declarations of the dummy function if - -Wredundant_decls is used. GCC 4.3 and later have a builtin + -Wredundant-decls is used. GCC 4.3 and later have a builtin __COUNTER__ macro that can let us generate unique identifiers for each dummy function, to suppress this warning. @@ -133,6 +133,10 @@ which do not support _Static_assert, also do not warn about the last declaration mentioned above. + * GCC warns if -Wnested-externs is enabled and verify() is used + within a function body; but inside a function, you can always + arrange to use verify_expr() instead. + * In C++, any struct definition inside sizeof is invalid. Use a template type to work around the problem. */ diff --git a/gl/xsize.c b/gl/xsize.c new file mode 100644 index 0000000000..4b4914c2ca --- /dev/null +++ b/gl/xsize.c @@ -0,0 +1,3 @@ +#include <config.h> +#define XSIZE_INLINE _GL_EXTERN_INLINE +#include "xsize.h" diff --git a/gl/xsize.h b/gl/xsize.h index 515327e97f..a2942b9555 100644 --- a/gl/xsize.h +++ b/gl/xsize.h @@ -27,6 +27,11 @@ # include <stdint.h> #endif +_GL_INLINE_HEADER_BEGIN +#ifndef XSIZE_INLINE +# define XSIZE_INLINE _GL_INLINE +#endif + /* The size of memory objects is often computed through expressions of type size_t. Example: void* p = malloc (header_size + n * element_size). @@ -48,7 +53,7 @@ ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX) /* Sum of two sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -59,7 +64,7 @@ xsum (size_t size1, size_t size2) } /* Sum of three sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -69,7 +74,7 @@ xsum3 (size_t size1, size_t size2, size_t size3) } /* Sum of four sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -79,7 +84,7 @@ xsum4 (size_t size1, size_t size2, size_t size3, size_t size4) } /* Maximum of two sizes, with overflow check. */ -static inline size_t +XSIZE_INLINE size_t #if __GNUC__ >= 3 __attribute__ ((__pure__)) #endif @@ -92,7 +97,7 @@ xmax (size_t size1, size_t size2) /* Multiplication of a count with an element size, with overflow check. The count must be >= 0 and the element size must be > 0. - This is a macro, not an inline function, so that it works correctly even + This is a macro, not a function, so that it works correctly even when N is of a wider type and N > SIZE_MAX. */ #define xtimes(N, ELSIZE) \ ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX) @@ -104,4 +109,6 @@ xmax (size_t size1, size_t size2) #define size_in_bounds_p(SIZE) \ ((SIZE) != SIZE_MAX) +_GL_INLINE_HEADER_END + #endif /* _XSIZE_H */ |