diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2024-01-20 11:45:04 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2024-01-20 11:45:38 -0800 |
commit | 3add626f1405739aa430adcc0b4c27e587a7c561 (patch) | |
tree | 1b30227dc3f70924a4ed92f662cec9276dea96c9 /m4 | |
parent | d276996c4f60395464ca8d5d7de487022b4937fa (diff) | |
download | emacs-3add626f1405739aa430adcc0b4c27e587a7c561.tar.gz |
Update from Gnulib by running admin/merge-gnulib
Diffstat (limited to 'm4')
56 files changed, 229 insertions, 211 deletions
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4 index 3448c40bbd6..99c99d1b0fb 100644 --- a/m4/00gnulib.m4 +++ b/m4/00gnulib.m4 @@ -1,4 +1,4 @@ -# 00gnulib.m4 serial 8 +# 00gnulib.m4 serial 9 dnl Copyright (C) 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -49,14 +49,14 @@ dnl AC_REQUIRE([gl_COMPILER_CLANG]) [if test $gl_cv_compiler_clang = yes; then dnl Test whether the compiler supports the option dnl '-Werror=implicit-function-declaration'. - save_ac_compile="$ac_compile" + saved_ac_compile="$ac_compile" ac_compile="$ac_compile -Werror=implicit-function-declaration" dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'], [gl_cv_compiler_check_decl_option=none]) - ac_compile="$save_ac_compile" + ac_compile="$saved_ac_compile" else gl_cv_compiler_check_decl_option=none fi @@ -71,11 +71,11 @@ dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC dnl in zzgnulib.m4 is inactive, use the original ac_compile. m4_define([_AC_CHECK_DECL_BODY], -[ ac_save_ac_compile="$ac_compile" +[ ac_saved_ac_compile="$ac_compile" if test -n "$ac_compile_for_check_decl"; then ac_compile="$ac_compile_for_check_decl" fi] -m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile" +m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile" ]) # gl_00GNULIB diff --git a/m4/absolute-header.m4 b/m4/absolute-header.m4 index aa7d0dac6da..0e9f9ba763a 100644 --- a/m4/absolute-header.m4 +++ b/m4/absolute-header.m4 @@ -1,4 +1,4 @@ -# absolute-header.m4 serial 17 +# absolute-header.m4 serial 18 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -66,7 +66,7 @@ AC_DEFUN([gl_ABSOLUTE_HEADER_ONE], esac changequote(,) case "$host_os" in - mingw*) + mingw* | windows*) dnl For the sake of native Windows compilers (excluding gcc), dnl treat backslash as a directory separator, like /. dnl Actually, these compilers use a double-backslash as diff --git a/m4/acl.m4 b/m4/acl.m4 index 199bf67cbc5..2050d108b0c 100644 --- a/m4/acl.m4 +++ b/m4/acl.m4 @@ -1,5 +1,5 @@ # acl.m4 - check for access control list (ACL) primitives -# serial 29 +# serial 30 # Copyright (C) 2002, 2004-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation @@ -27,7 +27,7 @@ AC_DEFUN_ONCE([gl_FUNC_ACL], dnl On all platforms, the ACL related API is declared in <sys/acl.h>. AC_CHECK_HEADERS([sys/acl.h]) if test $ac_cv_header_sys_acl_h = yes; then - ac_save_LIBS=$LIBS + gl_saved_LIBS=$LIBS dnl Test for POSIX-draft-like API (GNU/Linux, FreeBSD, Mac OS X, dnl IRIX, Tru64, Cygwin >= 2.5). @@ -129,7 +129,7 @@ int type = ACL_TYPE_EXTENDED;]])], fi fi - LIBS=$ac_save_LIBS + LIBS=$gl_saved_LIBS fi if test "$enable_acl$use_acl" = yes0; then diff --git a/m4/alloca.m4 b/m4/alloca.m4 index 911a003a04f..90960215382 100644 --- a/m4/alloca.m4 +++ b/m4/alloca.m4 @@ -1,6 +1,6 @@ # alloca.m4 serial 21 -dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software Foundation, +dnl 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. diff --git a/m4/assert_h.m4 b/m4/assert_h.m4 index a73e45f0641..d3d4c42519f 100644 --- a/m4/assert_h.m4 +++ b/m4/assert_h.m4 @@ -9,10 +9,10 @@ dnl From Paul Eggert. AC_DEFUN([gl_ASSERT_H], [ AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert], - [gl_save_CFLAGS=$CFLAGS + [gl_saved_CFLAGS=$CFLAGS for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do AS_CASE([$gl_working], - [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"]) + [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -32,7 +32,7 @@ AC_DEFUN([gl_ASSERT_H], ]])], [gl_cv_static_assert=$gl_working], [gl_cv_static_assert=no]) - CFLAGS=$gl_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$gl_cv_static_assert" != no && break done]) diff --git a/m4/canonicalize.m4 b/m4/canonicalize.m4 index a5831bb4b62..05dc6dd264d 100644 --- a/m4/canonicalize.m4 +++ b/m4/canonicalize.m4 @@ -1,4 +1,4 @@ -# canonicalize.m4 serial 38 +# canonicalize.m4 serial 39 dnl Copyright (C) 2003-2007, 2009-2024 Free Software Foundation, Inc. @@ -66,8 +66,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE], dnl available through the linker option '-loldnames'. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) ;; - *) AC_CHECK_FUNCS([getcwd]) ;; + mingw* | windows*) ;; + *) AC_CHECK_FUNCS([getcwd]) ;; esac AC_REQUIRE([gl_DOUBLE_SLASH_ROOT]) @@ -158,16 +158,16 @@ AC_DEFUN([gl_FUNC_REALPATH_WORKS], esac ], [case "$host_os" in - # Guess yes on glibc systems. - *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; - # Guess 'nearly' on musl systems. - *-musl*) gl_cv_func_realpath_works="guessing nearly" ;; - # Guess no on Cygwin. - cygwin*) gl_cv_func_realpath_works="guessing no" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_realpath_works="guessing no" ;; - # If we don't know, obey --enable-cross-guesses. - *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; + # Guess yes on glibc systems. + *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;; + # Guess 'nearly' on musl systems. + *-musl*) gl_cv_func_realpath_works="guessing nearly" ;; + # Guess no on Cygwin. + cygwin*) gl_cv_func_realpath_works="guessing no" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_realpath_works="guessing no" ;; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_realpath_works="$gl_cross_guess_normal" ;; esac ]) rm -rf conftest.a conftest.l conftest.d diff --git a/m4/clock_time.m4 b/m4/clock_time.m4 index 369e1412ec6..c016575c8ea 100644 --- a/m4/clock_time.m4 +++ b/m4/clock_time.m4 @@ -1,4 +1,4 @@ -# clock_time.m4 serial 13 +# clock_time.m4 serial 14 dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,7 +32,7 @@ AC_DEFUN([gl_CLOCK_TIME], CLOCK_TIME_LIB= AC_SUBST([CLOCK_TIME_LIB]) case "$host_os" in - mingw*) + mingw* | windows*) ac_cv_func_clock_getres=no ac_cv_func_clock_gettime=no ac_cv_func_clock_settime=no diff --git a/m4/codeset.m4 b/m4/codeset.m4 index 0b01779abc9..94dccce7775 100644 --- a/m4/codeset.m4 +++ b/m4/codeset.m4 @@ -1,6 +1,6 @@ # codeset.m4 serial 5 (gettext-0.18.2) -dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free -dnl Software Foundation, Inc. +dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software +dnl 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. diff --git a/m4/d-type.m4 b/m4/d-type.m4 index 13bab57a3a5..b06bca5a7dc 100644 --- a/m4/d-type.m4 +++ b/m4/d-type.m4 @@ -5,8 +5,7 @@ dnl dnl Check whether struct dirent has a member named d_type. dnl -# Copyright (C) 1997, 1999-2004, 2006, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 1997, 1999-2004, 2006, 2009-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/dirent_h.m4 b/m4/dirent_h.m4 index 1e55f025d28..3e3d967f499 100644 --- a/m4/dirent_h.m4 +++ b/m4/dirent_h.m4 @@ -1,4 +1,4 @@ -# dirent_h.m4 serial 20 +# dirent_h.m4 serial 22 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -32,14 +32,13 @@ AC_DEFUN_ONCE([gl_DIRENT_H], dnl Determine whether <dirent.h> needs to override the DIR type. AC_DEFUN_ONCE([gl_DIRENT_DIR], [ - dnl Set DIR_HAS_FD_MEMBER if dirfd() works, i.e. not always returns -1, - dnl or has the __KLIBC__ workaround as in lib/dirfd.c. + dnl Set DIR_HAS_FD_MEMBER if dirfd() works, i.e. not always returns -1. dnl We could use the findings from gl_FUNC_DIRFD and gl_PREREQ_DIRFD, but dnl it's simpler since we know the affected platforms. AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) DIR_HAS_FD_MEMBER=0 ;; - *) DIR_HAS_FD_MEMBER=1 ;; + mingw* | windows* | os2*) DIR_HAS_FD_MEMBER=0 ;; + *) DIR_HAS_FD_MEMBER=1 ;; esac AC_SUBST([DIR_HAS_FD_MEMBER]) ]) diff --git a/m4/dirfd.m4 b/m4/dirfd.m4 index 6578dc0232b..e58582e6145 100644 --- a/m4/dirfd.m4 +++ b/m4/dirfd.m4 @@ -1,4 +1,4 @@ -# serial 28 -*- Autoconf -*- +# serial 30 -*- Autoconf -*- dnl Find out how to get the file descriptor associated with an open DIR*. @@ -40,15 +40,12 @@ AC_DEFUN([gl_FUNC_DIRFD], HAVE_DIRFD=0 else HAVE_DIRFD=1 - dnl Replace dirfd() on native Windows, to support fdopendir(). + dnl Replace dirfd() on native Windows and OS/2 kLIBC, + dnl to support fdopendir(). AC_REQUIRE([gl_DIRENT_DIR]) if test $DIR_HAS_FD_MEMBER = 0; then REPLACE_DIRFD=1 fi - dnl OS/2 kLIBC dirfd() does not work. - case "$host_os" in - os2*) REPLACE_DIRFD=1 ;; - esac fi ]) @@ -58,7 +55,7 @@ AC_DEFUN([gl_PREREQ_DIRFD], AC_CACHE_CHECK([how to get the file descriptor associated with an open DIR*], [gl_cv_sys_dir_fd_member_name], [ - dirfd_save_CFLAGS=$CFLAGS + gl_saved_CFLAGS=$CFLAGS for ac_expr in d_fd dd_fd; do CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr" @@ -68,7 +65,7 @@ AC_DEFUN([gl_PREREQ_DIRFD], [[DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;]])], [dir_fd_found=yes] ) - CFLAGS=$dirfd_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$dir_fd_found" = yes && break done test "$dir_fd_found" = yes || ac_expr=no_such_member diff --git a/m4/dup2.m4 b/m4/dup2.m4 index 1833ff0ec17..f6759b647a6 100644 --- a/m4/dup2.m4 +++ b/m4/dup2.m4 @@ -1,6 +1,5 @@ -#serial 27 -dnl Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, -dnl Inc. +#serial 28 +dnl Copyright (C) 2002, 2005, 2007, 2009-2024 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. @@ -68,7 +67,7 @@ AC_DEFUN([gl_FUNC_DUP2], ], [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], [case "$host_os" in - mingw*) # on this platform, dup2 always returns 0 for success + mingw* | windows*) # on this platform, dup2 always returns 0 for success gl_cv_func_dup2_works="guessing no" ;; cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 gl_cv_func_dup2_works="guessing no" ;; diff --git a/m4/filemode.m4 b/m4/filemode.m4 index 3dd40f44b8b..b72317281b3 100644 --- a/m4/filemode.m4 +++ b/m4/filemode.m4 @@ -1,6 +1,5 @@ # filemode.m4 serial 9 -dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2024 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. diff --git a/m4/fstatat.m4 b/m4/fstatat.m4 index 1b5e5f19276..c22569b7961 100644 --- a/m4/fstatat.m4 +++ b/m4/fstatat.m4 @@ -1,4 +1,4 @@ -# fstatat.m4 serial 4 +# fstatat.m4 serial 5 dnl Copyright (C) 2004-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -50,7 +50,7 @@ AC_DEFUN([gl_FUNC_FSTATAT], esac case $host_os in - solaris*) + darwin* | solaris*) REPLACE_FSTATAT=1 ;; esac diff --git a/m4/fsusage.m4 b/m4/fsusage.m4 index 9a81dabe34c..31d424c857d 100644 --- a/m4/fsusage.m4 +++ b/m4/fsusage.m4 @@ -1,8 +1,7 @@ # serial 35 # Obtaining file system usage information. -# Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software -# Foundation, Inc. +# Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/getgroups.m4 b/m4/getgroups.m4 index 5062278b335..f6e0cbd3fce 100644 --- a/m4/getgroups.m4 +++ b/m4/getgroups.m4 @@ -1,10 +1,9 @@ -# serial 24 +# serial 25 dnl From Jim Meyering. dnl A wrapper around AC_FUNC_GETGROUPS. -# Copyright (C) 1996-1997, 1999-2004, 2008-2024 Free Software -# Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2004, 2008-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -21,7 +20,7 @@ AC_DEFUN([AC_FUNC_GETGROUPS], # If we don't yet have getgroups, see if it's in -lbsd. # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1. - ac_save_LIBS=$LIBS + gl_saved_LIBS=$LIBS if test $ac_cv_func_getgroups = no; then AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd]) fi @@ -57,7 +56,7 @@ AC_DEFUN([AC_FUNC_GETGROUPS], [Define to 1 if your system has a working `getgroups' function.]) ;; esac - LIBS=$ac_save_LIBS + LIBS=$gl_saved_LIBS ])# AC_FUNC_GETGROUPS AC_DEFUN([gl_FUNC_GETGROUPS], diff --git a/m4/getline.m4 b/m4/getline.m4 index d0e285dbc9f..1a7e89034bc 100644 --- a/m4/getline.m4 +++ b/m4/getline.m4 @@ -1,7 +1,7 @@ # getline.m4 serial 33 -dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software Foundation, +dnl Inc. dnl dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, diff --git a/m4/getloadavg.m4 b/m4/getloadavg.m4 index d25a594b215..9d0236f77fe 100644 --- a/m4/getloadavg.m4 +++ b/m4/getloadavg.m4 @@ -1,13 +1,13 @@ # Check for getloadavg. -# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free -# Software Foundation, Inc. +# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software +# Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -#serial 12 +#serial 13 # Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. # New applications should use gl_GETLOADAVG instead. @@ -20,7 +20,7 @@ AC_DEFUN([gl_GETLOADAVG], # Persuade glibc <stdlib.h> to declare getloadavg(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) -gl_save_LIBS=$LIBS +gl_saved_LIBS=$LIBS # getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, # NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. @@ -81,12 +81,12 @@ if test $ac_cv_func_getloadavg != yes; then fi fi -if test "x$gl_save_LIBS" = x; then +if test "x$gl_saved_LIBS" = x; then GETLOADAVG_LIBS=$LIBS else - GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"` + GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_saved_LIBS!!"` fi -LIBS=$gl_save_LIBS +LIBS=$gl_saved_LIBS AC_SUBST([GETLOADAVG_LIBS])dnl diff --git a/m4/getopt.m4 b/m4/getopt.m4 index cc0356390ba..be812d8459b 100644 --- a/m4/getopt.m4 +++ b/m4/getopt.m4 @@ -1,4 +1,4 @@ -# getopt.m4 serial 48 +# getopt.m4 serial 49 dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -197,8 +197,8 @@ main () fi else case "$host_os" in - darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; - *) gl_cv_func_getopt_posix="guessing yes";; + darwin* | aix* | mingw* | windows*) gl_cv_func_getopt_posix="guessing no";; + *) gl_cv_func_getopt_posix="guessing yes";; esac fi ]) diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 6ddaed2d569..55be445c31a 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 11 +# getrandom.m4 serial 13 dnl Copyright 2020-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,6 +9,8 @@ dnl Written by Paul Eggert. AC_DEFUN([gl_FUNC_GETRANDOM], [ AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS]) + AC_REQUIRE([AC_CANONICAL_HOST]) + gl_CHECK_FUNCS_ANDROID([getrandom], [[/* Additional includes are needed before <sys/random.h> on uClibc and Mac OS X. */ @@ -45,7 +47,7 @@ AC_DEFUN([gl_FUNC_GETRANDOM], fi case "$host_os" in - mingw*) + mingw* | windows*) AC_CHECK_HEADERS([bcrypt.h], [], [], [[#include <windows.h> ]]) diff --git a/m4/gettime.m4 b/m4/gettime.m4 index 61fdbb35d46..e450e6b9d05 100644 --- a/m4/gettime.m4 +++ b/m4/gettime.m4 @@ -1,6 +1,5 @@ # gettime.m4 serial 14 -dnl Copyright (C) 2002, 2004-2006, 2009-2024 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2004-2006, 2009-2024 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. diff --git a/m4/gettimeofday.m4 b/m4/gettimeofday.m4 index 6c2f8583603..35269914ced 100644 --- a/m4/gettimeofday.m4 +++ b/m4/gettimeofday.m4 @@ -1,7 +1,6 @@ -# serial 29 +# serial 30 -# Copyright (C) 2001-2003, 2005, 2007, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 2001-2003, 2005, 2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -58,7 +57,7 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict); dnl On mingw, the original gettimeofday has only a precision of 15.6 dnl milliseconds. So override it. case "$host_os" in - mingw*) REPLACE_GETTIMEOFDAY=1 ;; + mingw* | windows*) REPLACE_GETTIMEOFDAY=1 ;; esac fi AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone], diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4 index db0c8853d73..03d10fa51ea 100644 --- a/m4/gnulib-common.m4 +++ b/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 87 +# gnulib-common.m4 serial 90 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -114,10 +114,14 @@ AC_DEFUN([gl_COMMON_BODY], [ # define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4) #endif -/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */ -#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \ - && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710) -# pragma GCC diagnostic ignored "-Wpedantic" +/* Use __has_c_attribute if available. However, do not use with + pre-C23 GCC, which can issue false positives if -Wpedantic. */ +#if (defined __has_c_attribute \ + && ! (_GL_GNUC_PREREQ (4, 6) \ + && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710)) +# define _GL_HAVE___HAS_C_ATTRIBUTE 1 +#else +# define _GL_HAVE___HAS_C_ATTRIBUTE 0 #endif /* Define if, in a function declaration, the attributes in bracket syntax @@ -242,7 +246,7 @@ AC_DEFUN([gl_COMMON_BODY], [ in C++ also: namespace, class, template specialization. */ #ifndef _GL_ATTRIBUTE_DEPRECATED # ifndef _GL_BRACKET_BEFORE_ATTRIBUTE -# ifdef __has_c_attribute +# if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__deprecated__) # define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] # endif @@ -291,7 +295,7 @@ AC_DEFUN([gl_COMMON_BODY], [ /* Applies to: Empty statement (;), inside a 'switch' statement. */ /* Always expands to something. */ #ifndef _GL_ATTRIBUTE_FALLTHROUGH -# ifdef __has_c_attribute +# if _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__fallthrough__) # define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] # endif @@ -380,7 +384,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # if !defined __apple_build_version__ && __clang_major__ >= 10 # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif -# elif defined __has_c_attribute +# elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__maybe_unused__) # define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] # endif @@ -411,7 +415,7 @@ AC_DEFUN([gl_COMMON_BODY], [ # if __clang_major__ >= 1000 # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif -# elif defined __has_c_attribute +# elif _GL_HAVE___HAS_C_ATTRIBUTE # if __has_c_attribute (__nodiscard__) # define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] # endif @@ -466,11 +470,25 @@ AC_DEFUN([gl_COMMON_BODY], [ /* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. */ /* Applies to: functions. */ +/* After a function's parameter list, this attribute must come first, before + other attributes. */ #ifndef _GL_ATTRIBUTE_NOTHROW -# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus -# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +# if defined __cplusplus +# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4 +# if __cplusplus >= 201103L +# define _GL_ATTRIBUTE_NOTHROW noexcept (true) +# else +# define _GL_ATTRIBUTE_NOTHROW throw () +# endif +# else +# define _GL_ATTRIBUTE_NOTHROW +# endif # else -# define _GL_ATTRIBUTE_NOTHROW +# if _GL_HAS_ATTRIBUTE (nothrow) +# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) +# else +# define _GL_ATTRIBUTE_NOTHROW +# endif # endif #endif @@ -1056,6 +1074,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], dnl -Wno-pedantic >= 4.8 >= 3.9 dnl -Wno-sign-compare >= 3 >= 3.9 dnl -Wno-sign-conversion >= 4.3 >= 3.9 + dnl -Wno-tautological-out-of-range-compare - >= 3.9 dnl -Wno-type-limits >= 4.3 >= 3.9 dnl -Wno-undef >= 3 >= 3.9 dnl -Wno-unsuffixed-float-constants >= 4.5 @@ -1081,6 +1100,9 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS], #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-pedantic #endif + #if 3 < __clang_major__ + (9 <= __clang_minor__) + -Wno-tautological-constant-out-of-range-compare + #endif #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) -Wno-sign-conversion -Wno-type-limits @@ -1144,12 +1166,12 @@ AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS], if test $gl_cv_compiler_clang = yes; then dnl Test whether the compiler supports the option dnl '-Werror=unguarded-availability-new'. - save_ac_compile="$ac_compile" + saved_ac_compile="$ac_compile" ac_compile="$ac_compile -Werror=unguarded-availability-new" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], [gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'], [gl_cv_compiler_check_future_option=none]) - ac_compile="$save_ac_compile" + ac_compile="$saved_ac_compile" else gl_cv_compiler_check_future_option=none fi @@ -1197,14 +1219,14 @@ AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS], darwin*) if test "x$gl_cv_compiler_check_future_option" != "xnone"; then dnl Use a compile test, not a link test. - save_ac_compile="$ac_compile" + saved_ac_compile="$ac_compile" ac_compile="$ac_compile $gl_cv_compiler_check_future_option" - save_ac_compile_for_check_decl="$ac_compile_for_check_decl" + saved_ac_compile_for_check_decl="$ac_compile_for_check_decl" ac_compile_for_check_decl="$ac_compile_for_check_decl $gl_cv_compiler_check_future_option" unset [ac_cv_have_decl_][$1] AC_CHECK_DECL([$1], , , [$2]) - ac_compile="$save_ac_compile" - ac_compile_for_check_decl="$save_ac_compile_for_check_decl" + ac_compile="$saved_ac_compile" + ac_compile_for_check_decl="$saved_ac_compile_for_check_decl" [ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]" if test $[ac_cv_func_][$1] = yes; then [gl_cv_onwards_func_][$1]=yes diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index f3ac7cc2409..2e5b328e3d8 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -677,7 +677,7 @@ AC_DEFUN([gl_INIT], if $gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b; then :; else AC_REQUIRE([AC_CANONICAL_HOST]) gl_gnulib_enabled_260941c0e5dc67ec9e87d1fb321c300b=true - if case $host_os in mingw*) false;; *) :;; esac; then + if case $host_os in mingw* | windows*) false;; *) :;; esac; then func_gl_gnulib_m4code_open fi fi @@ -1005,13 +1005,13 @@ AC_DEFUN([gl_INIT], if test $REPLACE_GETLINE = 1; then func_gl_gnulib_m4code_getdelim fi - if case $host_os in mingw*) false;; *) test $HAVE_GETLOADAVG = 0 || test $REPLACE_GETLOADAVG = 1;; esac; then + if case $host_os in mingw* | windows*) false;; *) test $HAVE_GETLOADAVG = 0 || test $REPLACE_GETLOADAVG = 1;; esac; then func_gl_gnulib_m4code_open fi if test $REPLACE_GETOPT = 1; then func_gl_gnulib_m4code_be453cec5eecf5731a274f2de7f2db36 fi - if case $host_os in mingw*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then + if case $host_os in mingw* | windows*) false;; *) test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1;; esac; then func_gl_gnulib_m4code_open fi if test $HAVE_READLINKAT = 0 || test $REPLACE_READLINKAT = 1; then diff --git a/m4/group-member.m4 b/m4/group-member.m4 index e058ace62b9..60b3d526db2 100644 --- a/m4/group-member.m4 +++ b/m4/group-member.m4 @@ -1,7 +1,6 @@ # serial 14 -# Copyright (C) 1999-2001, 2003-2007, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 1999-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/include_next.m4 b/m4/include_next.m4 index 8a1c52c8564..70cb746f435 100644 --- a/m4/include_next.m4 +++ b/m4/include_next.m4 @@ -1,4 +1,4 @@ -# include_next.m4 serial 26 +# include_next.m4 serial 27 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -74,17 +74,17 @@ EOF #endif #define DEFINED_IN_CONFTESTD2 EOF - gl_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" + gl_saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2" dnl We intentionally avoid using AC_LANG_SOURCE here. AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], [gl_cv_have_include_next=yes], - [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" + [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2" AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], [gl_cv_have_include_next=buggy], [gl_cv_have_include_next=no]) ]) - CPPFLAGS="$gl_save_CPPFLAGS" + CPPFLAGS="$gl_saved_CPPFLAGS" rm -rf conftestd1a conftestd1b conftestd2 ]) PRAGMA_SYSTEM_HEADER= diff --git a/m4/largefile.m4 b/m4/largefile.m4 index 2ac98cc8c93..cbe9bc1f63d 100644 --- a/m4/largefile.m4 +++ b/m4/largefile.m4 @@ -247,7 +247,7 @@ AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], AC_REQUIRE([AC_CANONICAL_HOST]) if test $ac_opt_found != yes; then AS_CASE([$host_os], - [mingw*], + [mingw* | windows*], [ac_cv_sys_largefile_opts="supported through gnulib" ac_opt_found=yes] ) @@ -305,7 +305,7 @@ AC_DEFUN([gl_LARGEFILE], [ AC_REQUIRE([AC_CANONICAL_HOST]) case "$host_os" in - mingw*) + mingw* | windows*) dnl Native Windows. dnl mingw64 defines off_t to a 64-bit type already, if dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. diff --git a/m4/lstat.m4 b/m4/lstat.m4 index d69b3b2182e..48cc8653fe6 100644 --- a/m4/lstat.m4 +++ b/m4/lstat.m4 @@ -1,4 +1,4 @@ -# serial 34 +# serial 36 # Copyright (C) 1997-2001, 2003-2024 Free Software Foundation, Inc. # @@ -18,7 +18,7 @@ AC_DEFUN([gl_FUNC_LSTAT], if test $ac_cv_func_lstat = yes; then AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK]) case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in - solaris* | *no) + darwin* | solaris* | *no) REPLACE_LSTAT=1 ;; esac @@ -62,7 +62,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK], *-gnu* | gnu*) # Guess yes on glibc systems. gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;; - mingw*) + mingw* | windows*) # Guess no on native Windows. gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;; *) diff --git a/m4/malloc.m4 b/m4/malloc.m4 index 770b1ba0ccd..635d6726b11 100644 --- a/m4/malloc.m4 +++ b/m4/malloc.m4 @@ -1,4 +1,4 @@ -# malloc.m4 serial 29 +# malloc.m4 serial 31 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], [[#include <stdlib.h> ]], [[void *p = malloc (0); - int result = !p; + void * volatile vp = p; + int result = !vp; free (p); return result;]]) ], @@ -26,7 +27,7 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_malloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; @@ -128,7 +129,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX], dnl except on those platforms where we have seen 'test-malloc-gnu', dnl 'test-realloc-gnu', 'test-calloc-gnu' fail. case "$host_os" in - mingw*) + mingw* | windows*) gl_cv_func_malloc_posix=no ;; irix* | solaris*) dnl On IRIX 6.5, the three functions return NULL with errno unset diff --git a/m4/manywarnings.m4 b/m4/manywarnings.m4 index 4d44f3aa34d..3c6795ceb28 100644 --- a/m4/manywarnings.m4 +++ b/m4/manywarnings.m4 @@ -1,4 +1,4 @@ -# manywarnings.m4 serial 24 +# manywarnings.m4 serial 25 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -52,7 +52,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed], [gl_cv_cc_nomfi_needed], [gl_cv_cc_nomfi_needed=no - gl_save_CFLAGS="$CFLAGS" + gl_saved_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Wextra -Werror" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( @@ -71,7 +71,7 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], [CFLAGS="$CFLAGS -Wno-missing-field-initializers" AC_COMPILE_IFELSE([], [gl_cv_cc_nomfi_needed=yes])]) - CFLAGS="$gl_save_CFLAGS" + CFLAGS="$gl_saved_CFLAGS" ]) dnl Next, check if -Werror -Wuninitialized is useful with the @@ -79,13 +79,13 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC(C)], dnl has no effect if -O is not also used AC_CACHE_CHECK([whether -Wuninitialized is supported], [gl_cv_cc_uninitialized_supported], - [gl_save_CFLAGS="$CFLAGS" + [gl_saved_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" + CFLAGS="$gl_saved_CFLAGS" ]) ]) diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4 index 375b3b4cda9..94ce05d1a6a 100644 --- a/m4/mempcpy.m4 +++ b/m4/mempcpy.m4 @@ -1,6 +1,6 @@ # mempcpy.m4 serial 14 -dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation, +dnl 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. diff --git a/m4/memrchr.m4 b/m4/memrchr.m4 index 21604f0ef94..b4ccdfa3c8d 100644 --- a/m4/memrchr.m4 +++ b/m4/memrchr.m4 @@ -1,6 +1,6 @@ # memrchr.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, +dnl 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. diff --git a/m4/mktime.m4 b/m4/mktime.m4 index a4aeb9f76ba..0565e5e61fe 100644 --- a/m4/mktime.m4 +++ b/m4/mktime.m4 @@ -1,6 +1,6 @@ -# serial 38 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software -dnl Foundation, Inc. +# serial 39 +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, +dnl 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. @@ -264,9 +264,9 @@ main () [gl_cv_func_working_mktime=yes], [gl_cv_func_working_mktime=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_working_mktime="guessing no" ;; - *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_working_mktime="guessing no" ;; + *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; esac ]) fi @@ -287,7 +287,7 @@ AC_DEFUN([gl_FUNC_MKTIME], with the algorithmic workarounds.]) fi case "$host_os" in - mingw*) + mingw* | windows*) REPLACE_MKTIME=1 AC_DEFINE([NEED_MKTIME_WINDOWS], [1], [Define if the compilation of mktime.c should define 'mktime' diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4 index ad3f68cb75b..c51f590402f 100644 --- a/m4/nanosleep.m4 +++ b/m4/nanosleep.m4 @@ -1,4 +1,4 @@ -# serial 44 +# serial 46 dnl From Jim Meyering. dnl Check for the nanosleep function. @@ -21,7 +21,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], AC_CHECK_DECLS_ONCE([alarm]) - nanosleep_save_libs=$LIBS + gl_saved_LIBS=$LIBS # Solaris 2.5.1 needs -lposix4 to get the nanosleep function. # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4. @@ -116,11 +116,14 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], *) gl_cv_func_nanosleep=no ;; esac], [case "$host_os" in - linux*) # Guess it halfway works when the kernel is Linux. + # Guess it halfway works when the kernel is Linux. + linux*) gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;; - mingw*) # Guess no on native Windows. + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_nanosleep='guessing no' ;; - *) # If we don't know, obey --enable-cross-guesses. + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_nanosleep="$gl_cross_guess_normal" ;; esac ]) @@ -140,7 +143,7 @@ AC_DEFUN([gl_FUNC_NANOSLEEP], else HAVE_NANOSLEEP=0 fi - LIBS=$nanosleep_save_libs + LIBS=$gl_saved_LIBS # For backward compatibility. LIB_NANOSLEEP="$NANOSLEEP_LIB" diff --git a/m4/nstrftime.m4 b/m4/nstrftime.m4 index 01725b2a331..67250dc9455 100644 --- a/m4/nstrftime.m4 +++ b/m4/nstrftime.m4 @@ -1,7 +1,6 @@ # serial 37 -# Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 1996-1997, 1999-2007, 2009-2024 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/open.m4 b/m4/open.m4 index edbd8b93c83..91e5c31b59a 100644 --- a/m4/open.m4 +++ b/m4/open.m4 @@ -1,4 +1,4 @@ -# open.m4 serial 15 +# open.m4 serial 16 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_OPEN], AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) case "$host_os" in - mingw* | pw*) + mingw* | windows* | pw*) REPLACE_OPEN=1 ;; *) diff --git a/m4/pathmax.m4 b/m4/pathmax.m4 index b7ce9ff1468..a0fc296c9b2 100644 --- a/m4/pathmax.m4 +++ b/m4/pathmax.m4 @@ -1,6 +1,6 @@ # pathmax.m4 serial 11 -dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 Free Software Foundation, +dnl 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. diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4 index 81be9611db2..cb2ee900313 100644 --- a/m4/pthread_sigmask.m4 +++ b/m4/pthread_sigmask.m4 @@ -1,4 +1,4 @@ -# pthread_sigmask.m4 serial 22 +# pthread_sigmask.m4 serial 23 dnl Copyright (C) 2011-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -47,7 +47,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], if test -n "$LIBMULTITHREAD"; then AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD], - [gl_save_LIBS="$LIBS" + [gl_saved_LIBS="$LIBS" LIBS="$LIBS $LIBMULTITHREAD" AC_LINK_IFELSE( [AC_LANG_PROGRAM( @@ -58,7 +58,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], ], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes], [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then dnl pthread_sigmask is available with -pthread or -lpthread. @@ -164,7 +164,7 @@ AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK], AC_CACHE_CHECK([whether pthread_sigmask returns error numbers], [gl_cv_func_pthread_sigmask_return_works], [ - gl_save_LIBS="$LIBS" + gl_saved_LIBS="$LIBS" LIBS="$LIBS $PTHREAD_SIGMASK_LIB" AC_RUN_IFELSE( [AC_LANG_SOURCE([[ @@ -188,7 +188,7 @@ int main () gl_cv_func_pthread_sigmask_return_works="guessing yes";; esac ]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) case "$gl_cv_func_pthread_sigmask_return_works" in *no) @@ -214,7 +214,7 @@ int main () [dnl Link against $LIBMULTITHREAD, not only $PTHREAD_SIGMASK_LIB. dnl Otherwise we get a false positive on those platforms where dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no". - gl_save_LIBS=$LIBS + gl_saved_LIBS=$LIBS LIBS="$LIBS $LIBMULTITHREAD"]) AC_RUN_IFELSE( [AC_LANG_SOURCE([[ @@ -258,7 +258,7 @@ int main () [:], [gl_cv_func_pthread_sigmask_unblock_works=no], [:]) - m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS]) + m4_ifdef([gl_][THREADLIB], [LIBS=$gl_saved_LIBS]) ]) case "$gl_cv_func_pthread_sigmask_unblock_works" in *no) diff --git a/m4/readutmp.m4 b/m4/readutmp.m4 index d458a8b554a..ec40019735f 100644 --- a/m4/readutmp.m4 +++ b/m4/readutmp.m4 @@ -1,4 +1,4 @@ -# readutmp.m4 serial 30 +# readutmp.m4 serial 31 dnl Copyright (C) 2002-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -18,7 +18,7 @@ AC_DEFUN([gl_READUTMP], if test $ac_cv_header_systemd_sd_login_h = yes; then AC_CACHE_CHECK([for libsystemd version >= 254], [gl_cv_lib_readutmp_systemd], - [gl_save_LIBS="$LIBS" + [gl_saved_LIBS="$LIBS" LIBS="$LIBS -lsystemd" AC_LINK_IFELSE( [AC_LANG_PROGRAM([[ @@ -31,7 +31,7 @@ AC_DEFUN([gl_READUTMP], ], [gl_cv_lib_readutmp_systemd=yes], [gl_cv_lib_readutmp_systemd=no]) - LIBS="$gl_save_LIBS" + LIBS="$gl_saved_LIBS" ]) if test $gl_cv_lib_readutmp_systemd = yes; then AC_DEFINE([READUTMP_USE_SYSTEMD], [1], diff --git a/m4/realloc.m4 b/m4/realloc.m4 index 7c769644a6e..a59af2807c9 100644 --- a/m4/realloc.m4 +++ b/m4/realloc.m4 @@ -1,4 +1,4 @@ -# realloc.m4 serial 27 +# realloc.m4 serial 29 dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], [[#include <stdlib.h> ]], [[void *p = realloc (0, 0); - int result = !p; + void * volatile vp = p; + int result = !vp; free (p); return result;]]) ], @@ -26,7 +27,7 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF], # Guess yes on platforms where we know the result. *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ | gnu* | *-musl* | midipix* | midnightbsd* \ - | hpux* | solaris* | cygwin* | mingw* | msys* ) + | hpux* | solaris* | cygwin* | mingw* | windows* | msys* ) ac_cv_func_realloc_0_nonnull="guessing yes" ;; # If we don't know, obey --enable-cross-guesses. *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;; diff --git a/m4/regex.m4 b/m4/regex.m4 index 7a43e1c9a26..3dfeabea057 100644 --- a/m4/regex.m4 +++ b/m4/regex.m4 @@ -1,4 +1,4 @@ -# serial 74 +# serial 75 # Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc. # @@ -327,10 +327,10 @@ AC_DEFUN([gl_REGEX], [gl_cv_func_re_compile_pattern_working=yes], [gl_cv_func_re_compile_pattern_working=no], [case "$host_os" in - # Guess no on native Windows. - mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;; - # Otherwise obey --enable-cross-guesses. - *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_re_compile_pattern_working="guessing no" ;; + # Otherwise obey --enable-cross-guesses. + *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/sig2str.m4 b/m4/sig2str.m4 index 2cb77c58a46..ab3786b8954 100644 --- a/m4/sig2str.m4 +++ b/m4/sig2str.m4 @@ -1,6 +1,5 @@ # serial 7 -dnl Copyright (C) 2002, 2005-2006, 2009-2024 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2002, 2005-2006, 2009-2024 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. diff --git a/m4/ssize_t.m4 b/m4/ssize_t.m4 index 65c96fcf56b..25b28d77e4e 100644 --- a/m4/ssize_t.m4 +++ b/m4/ssize_t.m4 @@ -1,6 +1,5 @@ # ssize_t.m4 serial 6 -dnl Copyright (C) 2001-2003, 2006, 2010-2024 Free Software Foundation, -dnl Inc. +dnl Copyright (C) 2001-2003, 2006, 2010-2024 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. diff --git a/m4/stat-time.m4 b/m4/stat-time.m4 index 7535a4c7e5c..8bec2f5f815 100644 --- a/m4/stat-time.m4 +++ b/m4/stat-time.m4 @@ -1,7 +1,7 @@ # Checks for stat-related time functions. -# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free -# Software Foundation, Inc. +# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software +# Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/stdalign.m4 b/m4/stdalign.m4 index 2683fae7daf..e3c1e609236 100644 --- a/m4/stdalign.m4 +++ b/m4/stdalign.m4 @@ -13,10 +13,10 @@ AC_DEFUN([gl_ALIGNASOF], [ AC_CACHE_CHECK([for alignas and alignof], [gl_cv_header_working_stdalign_h], - [gl_save_CFLAGS=$CFLAGS + [gl_saved_CFLAGS=$CFLAGS for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do AS_CASE([$gl_working], - [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"]) + [*stdalign.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_STDALIGN_H"]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [[#include <stdint.h> @@ -56,7 +56,7 @@ AC_DEFUN([gl_ALIGNASOF], [gl_cv_header_working_stdalign_h=$gl_working], [gl_cv_header_working_stdalign_h=no]) - CFLAGS=$gl_save_CFLAGS + CFLAGS=$gl_saved_CFLAGS test "$gl_cv_header_working_stdalign_h" != no && break done]) @@ -112,7 +112,11 @@ AC_DEFUN([gl_ALIGNASOF], # define _Alignof(type) alignof (type) # else template <class __t> struct __alignof_helper { char __a; __t __b; }; -# define _Alignof(type) offsetof (__alignof_helper<type>, __b) +# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__ +# define _Alignof(type) __builtin_offsetof (__alignof_helper<type>, __b) +# else +# define _Alignof(type) offsetof (__alignof_helper<type>, __b) +# endif # define _GL_STDALIGN_NEEDS_STDDEF 1 # endif # else diff --git a/m4/stdint.m4 b/m4/stdint.m4 index 8c0d430c042..4aa250827cc 100644 --- a/m4/stdint.m4 +++ b/m4/stdint.m4 @@ -1,4 +1,4 @@ -# stdint.m4 serial 62 +# stdint.m4 serial 63 dnl Copyright (C) 2001-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -286,10 +286,10 @@ static const char *macro_values[] = [gl_cv_header_working_stdint_h=yes], [], [case "$host_os" in - # Guess yes on native Windows. - mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; - # In general, assume it works. - *) gl_cv_header_working_stdint_h="guessing yes" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_header_working_stdint_h="guessing yes" ;; + # In general, assume it works. + *) gl_cv_header_working_stdint_h="guessing yes" ;; esac ]) ]) diff --git a/m4/stdlib_h.m4 b/m4/stdlib_h.m4 index bd6ef381c69..92e67a74bb5 100644 --- a/m4/stdlib_h.m4 +++ b/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 75 +# stdlib_h.m4 serial 76 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -134,6 +134,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS], gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R]) + gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R]) gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY]) @@ -237,6 +238,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) + REPLACE_RAND=0; AC_SUBST([REPLACE_RAND]) REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU]) diff --git a/m4/string_h.m4 b/m4/string_h.m4 index 3cbcbc74873..8b12101447f 100644 --- a/m4/string_h.m4 +++ b/m4/string_h.m4 @@ -5,7 +5,7 @@ # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. -# serial 37 +# serial 38 # Written by Paul Eggert. @@ -146,5 +146,6 @@ AC_DEFUN([gl_STRING_H_DEFAULTS], REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) + REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP]) UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) ]) diff --git a/m4/strnlen.m4 b/m4/strnlen.m4 index 16b351a3d41..3eac8e629d7 100644 --- a/m4/strnlen.m4 +++ b/m4/strnlen.m4 @@ -1,6 +1,6 @@ # strnlen.m4 serial 14 -dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software -dnl Foundation, Inc. +dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, +dnl 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. diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4 index 0708d7e1ce8..b58fa48ff6e 100644 --- a/m4/strtoimax.m4 +++ b/m4/strtoimax.m4 @@ -1,6 +1,5 @@ -# strtoimax.m4 serial 16 -dnl Copyright (C) 2002-2004, 2006, 2009-2024 Free Software Foundation, -dnl Inc. +# strtoimax.m4 serial 17 +dnl Copyright (C) 2002-2004, 2006, 2009-2024 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. @@ -62,12 +61,12 @@ int main () [gl_cv_func_strtoimax=yes], [gl_cv_func_strtoimax=no], [case "$host_os" in - # Guess no on AIX 5. - aix5*) gl_cv_func_strtoimax="guessing no" ;; - # Guess yes on native Windows. - mingw*) gl_cv_func_strtoimax="guessing yes" ;; - # Guess yes otherwise. - *) gl_cv_func_strtoimax="guessing yes" ;; + # Guess no on AIX 5. + aix5*) gl_cv_func_strtoimax="guessing no" ;; + # Guess yes on native Windows. + mingw* | windows*) gl_cv_func_strtoimax="guessing yes" ;; + # Guess yes otherwise. + *) gl_cv_func_strtoimax="guessing yes" ;; esac ]) ]) diff --git a/m4/strtoll.m4 b/m4/strtoll.m4 index 5ba266f7687..130b9094d88 100644 --- a/m4/strtoll.m4 +++ b/m4/strtoll.m4 @@ -1,6 +1,5 @@ -# strtoll.m4 serial 11 -dnl Copyright (C) 2002, 2004, 2006, 2008-2024 Free Software Foundation, -dnl Inc. +# strtoll.m4 serial 12 +dnl Copyright (C) 2002, 2004, 2006, 2008-2024 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. @@ -45,7 +44,7 @@ AC_DEFUN([gl_FUNC_STRTOLL], [gl_cv_func_strtoll_works=no], [case "$host_os" in # Guess no on native Windows. - mingw*) gl_cv_func_strtoll_works="guessing no" ;; + mingw* | windows*) gl_cv_func_strtoll_works="guessing no" ;; # Guess no on glibc systems. *-gnu* | gnu*) gl_cv_func_strtoll_works="guessing no" ;; # Guess no on musl systems. diff --git a/m4/time_h.m4 b/m4/time_h.m4 index 07f82cdfaeb..367f69efae6 100644 --- a/m4/time_h.m4 +++ b/m4/time_h.m4 @@ -1,7 +1,6 @@ # Configure a more-standard replacement for <time.h>. -# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. # serial 24 diff --git a/m4/timespec.m4 b/m4/timespec.m4 index 0a1c90e550c..59a0db9966e 100644 --- a/m4/timespec.m4 +++ b/m4/timespec.m4 @@ -1,7 +1,6 @@ #serial 15 -# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software -# Foundation, Inc. +# Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, diff --git a/m4/unistd_h.m4 b/m4/unistd_h.m4 index 3a1cacaef55..e078bd617a7 100644 --- a/m4/unistd_h.m4 +++ b/m4/unistd_h.m4 @@ -1,4 +1,4 @@ -# unistd_h.m4 serial 94 +# unistd_h.m4 serial 95 dnl Copyright (C) 2006-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -234,6 +234,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS], REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) + REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR]) REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC]) REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) diff --git a/m4/utimes.m4 b/m4/utimes.m4 index 040b1af8050..05b23cbb736 100644 --- a/m4/utimes.m4 +++ b/m4/utimes.m4 @@ -1,5 +1,5 @@ # Detect some bugs in glibc's implementation of utimes. -# serial 8 +# serial 9 dnl Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation @@ -144,11 +144,11 @@ main () [gl_cv_func_working_utimes=yes], [gl_cv_func_working_utimes=no], [case "$host_os" in - # Guess yes on musl systems. - *-musl*) gl_cv_func_working_utimes="guessing yes" ;; - # Guess no on native Windows. - mingw*) gl_cv_func_working_utimes="guessing no" ;; - *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;; + # Guess yes on musl systems. + *-musl*) gl_cv_func_working_utimes="guessing yes" ;; + # Guess no on native Windows. + mingw* | windows*) gl_cv_func_working_utimes="guessing no" ;; + *) gl_cv_func_working_utimes="$gl_cross_guess_normal" ;; esac ]) ]) diff --git a/m4/warnings.m4 b/m4/warnings.m4 index 6c97ef194e4..d487636aa36 100644 --- a/m4/warnings.m4 +++ b/m4/warnings.m4 @@ -1,4 +1,4 @@ -# warnings.m4 serial 19 +# warnings.m4 serial 20 dnl Copyright (C) 2008-2024 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,13 +26,13 @@ case $gl_positive in esac m4_pushdef([gl_Positive], [$gl_positive])])dnl AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [ - gl_save_compiler_FLAGS="$gl_Flags" + gl_saved_compiler_FLAGS="$gl_Flags" AS_VAR_APPEND(m4_defn([gl_Flags]), [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["]) AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])], [AS_VAR_SET([gl_Warn], [yes])], [AS_VAR_SET([gl_Warn], [no])]) - gl_Flags="$gl_save_compiler_FLAGS" + gl_Flags="$gl_saved_compiler_FLAGS" ]) AS_VAR_IF(gl_Warn, [yes], [$2], [$3]) m4_popdef([gl_Positive])dnl |