summaryrefslogtreecommitdiffstats
path: root/gl/m4
diff options
context:
space:
mode:
authorLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 16:27:12 +0100
committerLorenz Kästle <12514511+RincewindsHat@users.noreply.github.com>2024-10-31 16:27:12 +0100
commit5be04ec2ceb1df77afbca4fcbf9e92a712612d6f (patch)
tree2b2e1c71dffae827c8e45cd4cccc375093d03486 /gl/m4
parent6d1d1dac32841d5ca6ee51bb09b30a6c604b17e2 (diff)
downloadmonitoring-plugins-5be04ec2ceb1df77afbca4fcbf9e92a712612d6f.tar.gz
Sync with the latest Gnulib code (d4ec02b3cc)
Diffstat (limited to 'gl/m4')
-rw-r--r--gl/m4/00gnulib.m413
-rw-r--r--gl/m4/__inline.m47
-rw-r--r--gl/m4/absolute-header.m47
-rw-r--r--gl/m4/af_alg.m45
-rw-r--r--gl/m4/alloca.m45
-rw-r--r--gl/m4/arpa_inet_h.m45
-rw-r--r--gl/m4/assert_h.m427
-rw-r--r--gl/m4/base64.m45
-rw-r--r--gl/m4/btowc.m485
-rw-r--r--gl/m4/builtin-expect.m48
-rw-r--r--gl/m4/byteswap.m45
-rw-r--r--gl/m4/c-bool.m48
-rw-r--r--gl/m4/calloc.m428
-rw-r--r--gl/m4/close.m47
-rw-r--r--gl/m4/codeset.m45
-rw-r--r--gl/m4/double-slash-root.m45
-rw-r--r--gl/m4/dup2.m47
-rw-r--r--gl/m4/eealloc.m45
-rw-r--r--gl/m4/environ.m45
-rw-r--r--gl/m4/errno_h.m45
-rw-r--r--gl/m4/error.m422
-rw-r--r--gl/m4/error_h.m4125
-rw-r--r--gl/m4/exponentd.m47
-rw-r--r--gl/m4/extensions.m424
-rw-r--r--gl/m4/extern-inline.m412
-rw-r--r--gl/m4/fclose.m499
-rw-r--r--gl/m4/fcntl-o.m411
-rw-r--r--gl/m4/fcntl.m47
-rw-r--r--gl/m4/fcntl_h.m46
-rw-r--r--gl/m4/fflush.m418
-rw-r--r--gl/m4/float_h.m413
-rw-r--r--gl/m4/floorf.m429
-rw-r--r--gl/m4/fopen.m424
-rw-r--r--gl/m4/fpurge.m415
-rw-r--r--gl/m4/freading.m410
-rw-r--r--gl/m4/free.m411
-rw-r--r--gl/m4/fseek.m45
-rw-r--r--gl/m4/fseeko.m45
-rw-r--r--gl/m4/fstat.m49
-rw-r--r--gl/m4/fstypename.m414
-rw-r--r--gl/m4/fsusage.m414
-rw-r--r--gl/m4/ftell.m45
-rw-r--r--gl/m4/ftello.m430
-rw-r--r--gl/m4/getaddrinfo.m49
-rw-r--r--gl/m4/getdelim.m414
-rw-r--r--gl/m4/getdtablesize.m45
-rw-r--r--gl/m4/gethostname.m49
-rw-r--r--gl/m4/getline.m423
-rw-r--r--gl/m4/getloadavg.m437
-rw-r--r--gl/m4/getopt.m49
-rw-r--r--gl/m4/getprogname.m433
-rw-r--r--gl/m4/gl-openssl.m48
-rw-r--r--gl/m4/gnulib-cache.m42
-rw-r--r--gl/m4/gnulib-common.m4426
-rw-r--r--gl/m4/gnulib-comp.m4100
-rw-r--r--gl/m4/gnulib-tool.m45
-rw-r--r--gl/m4/hostent.m49
-rw-r--r--gl/m4/idpriv.m45
-rw-r--r--gl/m4/include_next.m413
-rw-r--r--gl/m4/inet_ntop.m49
-rw-r--r--gl/m4/intmax_t.m45
-rw-r--r--gl/m4/inttypes.m49
-rw-r--r--gl/m4/inttypes_h.m45
-rw-r--r--gl/m4/iswblank.m439
-rw-r--r--gl/m4/iswctype.m414
-rw-r--r--gl/m4/iswdigit.m4121
-rw-r--r--gl/m4/iswpunct.m449
-rw-r--r--gl/m4/iswxdigit.m4111
-rw-r--r--gl/m4/langinfo_h.m45
-rw-r--r--gl/m4/largefile.m4229
-rw-r--r--gl/m4/limits-h.m431
-rw-r--r--gl/m4/localcharset.m45
-rw-r--r--gl/m4/locale-fr.m4142
-rw-r--r--gl/m4/locale-ja.m417
-rw-r--r--gl/m4/locale-zh.m415
-rw-r--r--gl/m4/locale_h.m411
-rw-r--r--gl/m4/localeconv.m442
-rw-r--r--gl/m4/lock.m45
-rw-r--r--gl/m4/lseek.m445
-rw-r--r--gl/m4/malloc.m414
-rw-r--r--gl/m4/malloca.m45
-rw-r--r--gl/m4/math_h.m460
-rw-r--r--gl/m4/mbrtowc.m4123
-rw-r--r--gl/m4/mbsinit.m47
-rw-r--r--gl/m4/mbstate_t.m45
-rw-r--r--gl/m4/mbtowc.m410
-rw-r--r--gl/m4/memchr.m417
-rw-r--r--gl/m4/minmax.m45
-rw-r--r--gl/m4/mktime.m415
-rw-r--r--gl/m4/mmap-anon.m45
-rw-r--r--gl/m4/mode_t.m45
-rw-r--r--gl/m4/mountlist.m418
-rw-r--r--gl/m4/msvc-inval.m45
-rw-r--r--gl/m4/msvc-nothrow.m45
-rw-r--r--gl/m4/multiarch.m45
-rw-r--r--gl/m4/musl.m421
-rw-r--r--gl/m4/netdb_h.m45
-rw-r--r--gl/m4/netinet_in_h.m45
-rw-r--r--gl/m4/nl_langinfo.m412
-rw-r--r--gl/m4/nocrash.m45
-rw-r--r--gl/m4/off_t.m45
-rw-r--r--gl/m4/open-cloexec.m48
-rw-r--r--gl/m4/open-slash.m45
-rw-r--r--gl/m4/open.m47
-rw-r--r--gl/m4/pathmax.m45
-rw-r--r--gl/m4/pid_t.m45
-rw-r--r--gl/m4/printf.m4931
-rw-r--r--gl/m4/pthread_rwlock_rdlock.m443
-rw-r--r--gl/m4/realloc.m412
-rw-r--r--gl/m4/reallocarray.m410
-rw-r--r--gl/m4/regex.m423
-rw-r--r--gl/m4/servent.m49
-rw-r--r--gl/m4/setenv.m420
-rw-r--r--gl/m4/setlocale_null.m446
-rw-r--r--gl/m4/sha256.m45
-rw-r--r--gl/m4/size_max.m45
-rw-r--r--gl/m4/snprintf.m45
-rw-r--r--gl/m4/socketlib.m419
-rw-r--r--gl/m4/sockets.m45
-rw-r--r--gl/m4/socklen.m45
-rw-r--r--gl/m4/sockpfaf.m45
-rw-r--r--gl/m4/ssize_t.m431
-rw-r--r--gl/m4/stat-time.m414
-rw-r--r--gl/m4/stat.m423
-rw-r--r--gl/m4/std-gnu11.m45
-rw-r--r--gl/m4/stdalign.m4202
-rw-r--r--gl/m4/stddef_h.m420
-rw-r--r--gl/m4/stdint.m418
-rw-r--r--gl/m4/stdint_h.m45
-rw-r--r--gl/m4/stdio_h.m439
-rw-r--r--gl/m4/stdlib_h.m472
-rw-r--r--gl/m4/strcase.m45
-rw-r--r--gl/m4/strcasestr.m45
-rw-r--r--gl/m4/strerror.m433
-rw-r--r--gl/m4/string_h.m418
-rw-r--r--gl/m4/strings_h.m411
-rw-r--r--gl/m4/strsep.m45
-rw-r--r--gl/m4/strstr.m45
-rw-r--r--gl/m4/sys_socket_h.m45
-rw-r--r--gl/m4/sys_stat_h.m45
-rw-r--r--gl/m4/sys_types_h.m45
-rw-r--r--gl/m4/sys_uio_h.m45
-rw-r--r--gl/m4/threadlib.m463
-rw-r--r--gl/m4/time_h.m448
-rw-r--r--gl/m4/time_r.m412
-rw-r--r--gl/m4/timegm.m411
-rw-r--r--gl/m4/ungetc.m425
-rw-r--r--gl/m4/unistd_h.m411
-rw-r--r--gl/m4/unlocked-io.m413
-rw-r--r--gl/m4/vararrays.m414
-rw-r--r--gl/m4/vasnprintf.m4207
-rw-r--r--gl/m4/vasprintf.m45
-rw-r--r--gl/m4/visibility.m413
-rw-r--r--gl/m4/vsnprintf.m45
-rw-r--r--gl/m4/warn-on-use.m49
-rw-r--r--gl/m4/wchar_h.m425
-rw-r--r--gl/m4/wchar_t.m45
-rw-r--r--gl/m4/wcrtomb.m423
-rw-r--r--gl/m4/wctype.m452
-rw-r--r--gl/m4/wctype_h.m49
-rw-r--r--gl/m4/wint_t.m45
-rw-r--r--gl/m4/xalloc.m45
-rw-r--r--gl/m4/xsize.m45
-rw-r--r--gl/m4/zzgnulib.m45
164 files changed, 3713 insertions, 1296 deletions
diff --git a/gl/m4/00gnulib.m4 b/gl/m4/00gnulib.m4
index 7fe03e0b..cd167718 100644
--- a/gl/m4/00gnulib.m4
+++ b/gl/m4/00gnulib.m4
@@ -1,5 +1,6 @@
1# 00gnulib.m4 serial 8 1# 00gnulib.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -49,14 +50,14 @@ dnl AC_REQUIRE([gl_COMPILER_CLANG])
49 [if test $gl_cv_compiler_clang = yes; then 50 [if test $gl_cv_compiler_clang = yes; then
50 dnl Test whether the compiler supports the option 51 dnl Test whether the compiler supports the option
51 dnl '-Werror=implicit-function-declaration'. 52 dnl '-Werror=implicit-function-declaration'.
52 save_ac_compile="$ac_compile" 53 saved_ac_compile="$ac_compile"
53 ac_compile="$ac_compile -Werror=implicit-function-declaration" 54 ac_compile="$ac_compile -Werror=implicit-function-declaration"
54 dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a 55 dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
55 dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". 56 dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
56 _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])], 57 _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
57 [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'], 58 [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
58 [gl_cv_compiler_check_decl_option=none]) 59 [gl_cv_compiler_check_decl_option=none])
59 ac_compile="$save_ac_compile" 60 ac_compile="$saved_ac_compile"
60 else 61 else
61 gl_cv_compiler_check_decl_option=none 62 gl_cv_compiler_check_decl_option=none
62 fi 63 fi
@@ -71,11 +72,11 @@ dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
71dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC 72dnl instead of ac_compile. If, for whatever reason, the override of AC_PROG_CC
72dnl in zzgnulib.m4 is inactive, use the original ac_compile. 73dnl in zzgnulib.m4 is inactive, use the original ac_compile.
73m4_define([_AC_CHECK_DECL_BODY], 74m4_define([_AC_CHECK_DECL_BODY],
74[ ac_save_ac_compile="$ac_compile" 75[ ac_saved_ac_compile="$ac_compile"
75 if test -n "$ac_compile_for_check_decl"; then 76 if test -n "$ac_compile_for_check_decl"; then
76 ac_compile="$ac_compile_for_check_decl" 77 ac_compile="$ac_compile_for_check_decl"
77 fi] 78 fi]
78m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_save_ac_compile" 79m4_defn([_AC_CHECK_DECL_BODY])[ ac_compile="$ac_saved_ac_compile"
79]) 80])
80 81
81# gl_00GNULIB 82# gl_00GNULIB
diff --git a/gl/m4/__inline.m4 b/gl/m4/__inline.m4
index acf8668b..20baf164 100644
--- a/gl/m4/__inline.m4
+++ b/gl/m4/__inline.m4
@@ -1,9 +1,12 @@
1# Test for __inline keyword 1# __inline.m4
2dnl Copyright 2017-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright 2017-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6 7
8# Test for __inline keyword
9
7AC_DEFUN([gl___INLINE], 10AC_DEFUN([gl___INLINE],
8[ 11[
9 AC_CACHE_CHECK([whether the compiler supports the __inline keyword], 12 AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
diff --git a/gl/m4/absolute-header.m4 b/gl/m4/absolute-header.m4
index e7947648..0abd6d90 100644
--- a/gl/m4/absolute-header.m4
+++ b/gl/m4/absolute-header.m4
@@ -1,5 +1,6 @@
1# absolute-header.m4 serial 17 1# absolute-header.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 18
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -66,7 +67,7 @@ AC_DEFUN([gl_ABSOLUTE_HEADER_ONE],
66 esac 67 esac
67changequote(,) 68changequote(,)
68 case "$host_os" in 69 case "$host_os" in
69 mingw*) 70 mingw* | windows*)
70 dnl For the sake of native Windows compilers (excluding gcc), 71 dnl For the sake of native Windows compilers (excluding gcc),
71 dnl treat backslash as a directory separator, like /. 72 dnl treat backslash as a directory separator, like /.
72 dnl Actually, these compilers use a double-backslash as 73 dnl Actually, these compilers use a double-backslash as
diff --git a/gl/m4/af_alg.m4 b/gl/m4/af_alg.m4
index f4c0d624..33b74945 100644
--- a/gl/m4/af_alg.m4
+++ b/gl/m4/af_alg.m4
@@ -1,5 +1,6 @@
1# af_alg.m4 serial 6 1# af_alg.m4
2dnl Copyright 2018-2023 Free Software Foundation, Inc. 2# serial 6
3dnl Copyright 2018-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/alloca.m4 b/gl/m4/alloca.m4
index c685fac9..dc78dc19 100644
--- a/gl/m4/alloca.m4
+++ b/gl/m4/alloca.m4
@@ -1,5 +1,6 @@
1# alloca.m4 serial 21 1# alloca.m4
2dnl Copyright (C) 2002-2004, 2006-2007, 2009-2023 Free Software Foundation, 2# serial 21
3dnl Copyright (C) 2002-2004, 2006-2007, 2009-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/arpa_inet_h.m4 b/gl/m4/arpa_inet_h.m4
index fa5fe831..9eac86d7 100644
--- a/gl/m4/arpa_inet_h.m4
+++ b/gl/m4/arpa_inet_h.m4
@@ -1,5 +1,6 @@
1# arpa_inet_h.m4 serial 17 1# arpa_inet_h.m4
2dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc. 2# serial 17
3dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/assert_h.m4 b/gl/m4/assert_h.m4
index abba4fa3..b90d0f19 100644
--- a/gl/m4/assert_h.m4
+++ b/gl/m4/assert_h.m4
@@ -1,5 +1,6 @@
1# assert-h.m4 1# assert_h.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -9,16 +10,16 @@ dnl From Paul Eggert.
9AC_DEFUN([gl_ASSERT_H], 10AC_DEFUN([gl_ASSERT_H],
10[ 11[
11 AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert], 12 AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
12 [gl_save_CFLAGS=$CFLAGS 13 [gl_saved_CFLAGS=$CFLAGS
13 for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do 14 for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
14 AS_CASE([$gl_working], 15 AS_CASE([$gl_working],
15 [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"]) 16 [*assert.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_ASSERT_H"])
16 17
17 AC_COMPILE_IFELSE( 18 AC_COMPILE_IFELSE(
18 [AC_LANG_PROGRAM( 19 [AC_LANG_PROGRAM(
19 [[#if defined __clang__ && __STDC_VERSION__ < 202311 20 [[#if defined __clang__ && __STDC_VERSION__ < 202311
20 #pragma clang diagnostic error "-Wc2x-extensions" 21 #pragma clang diagnostic error "-Wc2x-extensions"
21 #pragma clang diagnostic error "-Wc++17-extensions" 22 #pragma clang diagnostic error "-Wc++1z-extensions"
22 #endif 23 #endif
23 #ifdef INCLUDE_ASSERT_H 24 #ifdef INCLUDE_ASSERT_H
24 #include <assert.h> 25 #include <assert.h>
@@ -32,7 +33,7 @@ AC_DEFUN([gl_ASSERT_H],
32 ]])], 33 ]])],
33 [gl_cv_static_assert=$gl_working], 34 [gl_cv_static_assert=$gl_working],
34 [gl_cv_static_assert=no]) 35 [gl_cv_static_assert=no])
35 CFLAGS=$gl_save_CFLAGS 36 CFLAGS=$gl_saved_CFLAGS
36 test "$gl_cv_static_assert" != no && break 37 test "$gl_cv_static_assert" != no && break
37 done]) 38 done])
38 39
@@ -46,10 +47,13 @@ AC_DEFUN([gl_ASSERT_H],
46 gl_NEXT_HEADERS([assert.h])]) 47 gl_NEXT_HEADERS([assert.h])])
47 48
48 dnl The "zz" puts this toward config.h's end, to avoid potential 49 dnl The "zz" puts this toward config.h's end, to avoid potential
49 dnl collisions with other definitions. #undef assert so that 50 dnl collisions with other definitions.
50 dnl programs are not tempted to use it without specifically 51 dnl #undef assert so that programs are not tempted to use it without
51 dnl including assert.h. Break the #undef apart with a comment 52 dnl specifically including assert.h.
52 dnl so that 'configure' does not comment it out. 53 dnl #undef __ASSERT_H__ so that on IRIX, when programs later include
54 dnl <assert.h>, this include actually defines assert.
55 dnl Break the #undef_s apart with a comment so that 'configure' does
56 dnl not comment them out.
53 AH_VERBATIM([zzstatic_assert], 57 AH_VERBATIM([zzstatic_assert],
54[#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \ 58[#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
55 && (!defined __cplusplus \ 59 && (!defined __cplusplus \
@@ -57,6 +61,9 @@ AC_DEFUN([gl_ASSERT_H],
57 && __GNUG__ < 6 && __clang_major__ < 6))) 61 && __GNUG__ < 6 && __clang_major__ < 6)))
58 #include <assert.h> 62 #include <assert.h>
59 #undef/**/assert 63 #undef/**/assert
64 #ifdef __sgi
65 #undef/**/__ASSERT_H__
66 #endif
60 /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments. 67 /* Solaris 11.4 <assert.h> defines static_assert as a macro with 2 arguments.
61 We need it also to be invocable with a single argument. */ 68 We need it also to be invocable with a single argument. */
62 #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus 69 #if defined __sun && (__STDC_VERSION__ - 0 >= 201112L) && !defined __cplusplus
diff --git a/gl/m4/base64.m4 b/gl/m4/base64.m4
index 987930ab..26f2af41 100644
--- a/gl/m4/base64.m4
+++ b/gl/m4/base64.m4
@@ -1,5 +1,6 @@
1# base64.m4 serial 4 1# base64.m4
2dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2004, 2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/btowc.m4 b/gl/m4/btowc.m4
index 77218a7d..d9dd7036 100644
--- a/gl/m4/btowc.m4
+++ b/gl/m4/btowc.m4
@@ -1,5 +1,6 @@
1# btowc.m4 serial 12 1# btowc.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -40,12 +41,12 @@ int main ()
40 [ 41 [
41changequote(,)dnl 42changequote(,)dnl
42 case "$host_os" in 43 case "$host_os" in
43 # Guess no on Cygwin. 44 # Guess no on Cygwin.
44 cygwin*) gl_cv_func_btowc_nul="guessing no" ;; 45 cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
45 # Guess yes on native Windows. 46 # Guess yes on native Windows.
46 mingw*) gl_cv_func_btowc_nul="guessing yes" ;; 47 mingw* | windows*) gl_cv_func_btowc_nul="guessing yes" ;;
47 # Guess yes otherwise. 48 # Guess yes otherwise.
48 *) gl_cv_func_btowc_nul="guessing yes" ;; 49 *) gl_cv_func_btowc_nul="guessing yes" ;;
49 esac 50 esac
50changequote([,])dnl 51changequote([,])dnl
51 ]) 52 ])
@@ -59,12 +60,12 @@ changequote([,])dnl
59 dnl is present. 60 dnl is present.
60changequote(,)dnl 61changequote(,)dnl
61 case "$host_os" in 62 case "$host_os" in
62 # Guess no on IRIX. 63 # Guess no on IRIX.
63 irix*) gl_cv_func_btowc_eof="guessing no" ;; 64 irix*) gl_cv_func_btowc_eof="guessing no" ;;
64 # Guess yes on native Windows. 65 # Guess yes on native Windows.
65 mingw*) gl_cv_func_btowc_eof="guessing yes" ;; 66 mingw* | windows*) gl_cv_func_btowc_eof="guessing yes" ;;
66 # Guess yes otherwise. 67 # Guess yes otherwise.
67 *) gl_cv_func_btowc_eof="guessing yes" ;; 68 *) gl_cv_func_btowc_eof="guessing yes" ;;
68 esac 69 esac
69changequote([,])dnl 70changequote([,])dnl
70 if test $LOCALE_FR != none; then 71 if test $LOCALE_FR != none; then
@@ -88,6 +89,50 @@ int main ()
88 fi 89 fi
89 ]) 90 ])
90 91
92 dnl On mingw, in the C locale, btowc is inconsistent with mbrtowc:
93 dnl mbrtowc avoids calling MultiByteToWideChar when MB_CUR_MAX is 1 and
94 dnl ___lc_codepage_func() is 0, but btowc is lacking this special case.
95 AC_CHECK_FUNCS_ONCE([mbrtowc])
96 AC_CACHE_CHECK([whether btowc is consistent with mbrtowc in the C locale],
97 [gl_cv_func_btowc_consistent],
98 [
99 AC_RUN_IFELSE(
100 [AC_LANG_SOURCE([[
101#include <stdlib.h>
102#include <string.h>
103#include <wchar.h>
104int main ()
105{
106#if HAVE_MBRTOWC
107 wint_t wc1 = btowc (0x80);
108 wchar_t wc2 = (wchar_t) 0xbadface;
109 char buf[1] = { 0x80 };
110 mbstate_t state;
111 memset (&state, 0, sizeof (mbstate_t));
112 if (mbrtowc (&wc2, buf, 1, &state) != 1 || wc1 != wc2)
113 return 1;
114#endif
115 return 0;
116}]])],
117 [gl_cv_func_btowc_consistent=yes],
118 [gl_cv_func_btowc_consistent=no],
119 [case "$host_os" in
120 # Guess no on mingw.
121 mingw* | windows*)
122 AC_EGREP_CPP([Problem], [
123#ifdef __MINGW32__
124 Problem
125#endif
126 ],
127 [gl_cv_func_btowc_consistent="guessing no"],
128 [gl_cv_func_btowc_consistent="guessing yes"])
129 ;;
130 # Guess yes otherwise.
131 *) gl_cv_func_btowc_consistent="guessing yes" ;;
132 esac
133 ])
134 ])
135
91 case "$gl_cv_func_btowc_nul" in 136 case "$gl_cv_func_btowc_nul" in
92 *yes) ;; 137 *yes) ;;
93 *) REPLACE_BTOWC=1 ;; 138 *) REPLACE_BTOWC=1 ;;
@@ -96,10 +141,22 @@ int main ()
96 *yes) ;; 141 *yes) ;;
97 *) REPLACE_BTOWC=1 ;; 142 *) REPLACE_BTOWC=1 ;;
98 esac 143 esac
144 case "$gl_cv_func_btowc_consistent" in
145 *yes) ;;
146 *) REPLACE_BTOWC=1 ;;
147 esac
148 if test $REPLACE_BTOWC = 0; then
149 gl_MBRTOWC_C_LOCALE
150 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
151 *yes) ;;
152 *) REPLACE_BTOWC=1 ;;
153 esac
154 fi
99 fi 155 fi
100]) 156])
101 157
102# Prerequisites of lib/btowc.c. 158# Prerequisites of lib/btowc.c.
103AC_DEFUN([gl_PREREQ_BTOWC], [ 159AC_DEFUN([gl_PREREQ_BTOWC], [
104 : 160 :
161 AC_CHECK_FUNCS_ONCE([mbrtowc])
105]) 162])
diff --git a/gl/m4/builtin-expect.m4 b/gl/m4/builtin-expect.m4
index 531ed48a..c7af926b 100644
--- a/gl/m4/builtin-expect.m4
+++ b/gl/m4/builtin-expect.m4
@@ -1,10 +1,12 @@
1dnl Check for __builtin_expect. 1# builtin-expect.m4
2 2# serial 1
3dnl Copyright 2016-2023 Free Software Foundation, Inc. 3dnl Copyright 2016-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl Check for __builtin_expect.
9
8dnl Written by Paul Eggert. 10dnl Written by Paul Eggert.
9 11
10AC_DEFUN([gl___BUILTIN_EXPECT], 12AC_DEFUN([gl___BUILTIN_EXPECT],
diff --git a/gl/m4/byteswap.m4 b/gl/m4/byteswap.m4
index 8058d178..0c76fe93 100644
--- a/gl/m4/byteswap.m4
+++ b/gl/m4/byteswap.m4
@@ -1,5 +1,6 @@
1# byteswap.m4 serial 5 1# byteswap.m4
2dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/c-bool.m4 b/gl/m4/c-bool.m4
index f614371b..0fb0de3b 100644
--- a/gl/m4/c-bool.m4
+++ b/gl/m4/c-bool.m4
@@ -1,10 +1,12 @@
1# Check for bool that conforms to C2023. 1# c-bool.m4
2 2# serial 1
3dnl Copyright 2022-2023 Free Software Foundation, Inc. 3dnl Copyright 2022-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# Check for bool that conforms to C2023.
9
8AC_DEFUN([gl_C_BOOL], 10AC_DEFUN([gl_C_BOOL],
9[ 11[
10 AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool], 12 AC_CACHE_CHECK([for bool, true, false], [gl_cv_c_bool],
diff --git a/gl/m4/calloc.m4 b/gl/m4/calloc.m4
index 23c0dd9f..550cf5cc 100644
--- a/gl/m4/calloc.m4
+++ b/gl/m4/calloc.m4
@@ -1,9 +1,9 @@
1# calloc.m4 serial 29 1# calloc.m4
2 2# serial 31
3# Copyright (C) 2004-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# Written by Jim Meyering. 8# Written by Jim Meyering.
9 9
@@ -36,14 +36,14 @@ AC_DEFUN([_AC_FUNC_CALLOC_IF],
36 [ac_cv_func_calloc_0_nonnull=no]) 36 [ac_cv_func_calloc_0_nonnull=no])
37 else 37 else
38 case "$host_os" in 38 case "$host_os" in
39 # Guess yes on glibc systems. 39 # Guess yes on glibc systems.
40 *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; 40 *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
41 # Guess yes on musl systems. 41 # Guess yes on musl systems.
42 *-musl*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; 42 *-musl* | midipix*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
43 # Guess yes on native Windows. 43 # Guess yes on native Windows.
44 mingw*) ac_cv_func_calloc_0_nonnull="guessing yes" ;; 44 mingw* | windows*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
45 # If we don't know, obey --enable-cross-guesses. 45 # If we don't know, obey --enable-cross-guesses.
46 *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;; 46 *) ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
47 esac 47 esac
48 fi 48 fi
49 ]) 49 ])
diff --git a/gl/m4/close.m4 b/gl/m4/close.m4
index 9f95c670..88c37fab 100644
--- a/gl/m4/close.m4
+++ b/gl/m4/close.m4
@@ -1,10 +1,11 @@
1# close.m4 serial 9 1# close.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 10
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6 7
7AC_DEFUN([gl_FUNC_CLOSE], 8AC_DEFUN_ONCE([gl_FUNC_CLOSE],
8[ 9[
9 AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) 10 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10 m4_ifdef([gl_MSVC_INVAL], [ 11 m4_ifdef([gl_MSVC_INVAL], [
diff --git a/gl/m4/codeset.m4 b/gl/m4/codeset.m4
index 5804f472..e69b7402 100644
--- a/gl/m4/codeset.m4
+++ b/gl/m4/codeset.m4
@@ -1,5 +1,6 @@
1# codeset.m4 serial 5 (gettext-0.18.2) 1# codeset.m4
2dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2023 Free Software 2# serial 5 (gettext-0.18.2)
3dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2024 Free Software
3dnl Foundation, Inc. 4dnl Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/double-slash-root.m4 b/gl/m4/double-slash-root.m4
index 1776e5eb..3437c699 100644
--- a/gl/m4/double-slash-root.m4
+++ b/gl/m4/double-slash-root.m4
@@ -1,5 +1,6 @@
1# double-slash-root.m4 serial 4 -*- Autoconf -*- 1# double-slash-root.m4
2dnl Copyright (C) 2006, 2008-2023 Free Software Foundation, Inc. 2# serial 4 -*- Autoconf -*-
3dnl Copyright (C) 2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/dup2.m4 b/gl/m4/dup2.m4
index e1cc73e1..786121fd 100644
--- a/gl/m4/dup2.m4
+++ b/gl/m4/dup2.m4
@@ -1,5 +1,6 @@
1#serial 27 1# dup2.m4
2dnl Copyright (C) 2002, 2005, 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 28
3dnl Copyright (C) 2002, 2005, 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -67,7 +68,7 @@ AC_DEFUN([gl_FUNC_DUP2],
67 ], 68 ],
68 [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no], 69 [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
69 [case "$host_os" in 70 [case "$host_os" in
70 mingw*) # on this platform, dup2 always returns 0 for success 71 mingw* | windows*) # on this platform, dup2 always returns 0 for success
71 gl_cv_func_dup2_works="guessing no" ;; 72 gl_cv_func_dup2_works="guessing no" ;;
72 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0 73 cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
73 gl_cv_func_dup2_works="guessing no" ;; 74 gl_cv_func_dup2_works="guessing no" ;;
diff --git a/gl/m4/eealloc.m4 b/gl/m4/eealloc.m4
index cb3e08fe..8a15e705 100644
--- a/gl/m4/eealloc.m4
+++ b/gl/m4/eealloc.m4
@@ -1,5 +1,6 @@
1# eealloc.m4 serial 3 1# eealloc.m4
2dnl Copyright (C) 2003, 2009-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2003, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/environ.m4 b/gl/m4/environ.m4
index 741dfc56..107960b2 100644
--- a/gl/m4/environ.m4
+++ b/gl/m4/environ.m4
@@ -1,5 +1,6 @@
1# environ.m4 serial 8 1# environ.m4
2dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2001-2004, 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/errno_h.m4 b/gl/m4/errno_h.m4
index 4c70d225..b6050e5d 100644
--- a/gl/m4/errno_h.m4
+++ b/gl/m4/errno_h.m4
@@ -1,5 +1,6 @@
1# errno_h.m4 serial 14 1# errno_h.m4
2dnl Copyright (C) 2004, 2006, 2008-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2004, 2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/error.m4 b/gl/m4/error.m4
index 8cc75dff..273b636b 100644
--- a/gl/m4/error.m4
+++ b/gl/m4/error.m4
@@ -1,22 +1,12 @@
1#serial 15 1# error.m4
2 2# serial 16
3# Copyright (C) 1996-1998, 2001-2004, 2009-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 1996-1998, 2001-2004, 2009-2024 Free Software Foundation, Inc.
4# 4dnl This file is free software; the Free Software Foundation
5# This file is free software; the Free Software Foundation 5dnl gives unlimited permission to copy and/or distribute it,
6# gives unlimited permission to copy and/or distribute it, 6dnl with or without modifications, as long as this notice is preserved.
7# with or without modifications, as long as this notice is preserved.
8 7
9AC_DEFUN([gl_ERROR], 8AC_DEFUN([gl_ERROR],
10[ 9[
11 dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
12 dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
13 AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
14 [AC_LINK_IFELSE(
15 [AC_LANG_PROGRAM(
16 [[#include <error.h>]],
17 [[error_at_line (0, 0, "", 0, "an error occurred");]])],
18 [ac_cv_lib_error_at_line=yes],
19 [ac_cv_lib_error_at_line=no])])
20]) 10])
21 11
22# Prerequisites of lib/error.c. 12# Prerequisites of lib/error.c.
diff --git a/gl/m4/error_h.m4 b/gl/m4/error_h.m4
new file mode 100644
index 00000000..050a410c
--- /dev/null
+++ b/gl/m4/error_h.m4
@@ -0,0 +1,125 @@
1# error_h.m4
2# serial 4
3dnl Copyright (C) 1996-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8dnl From Bruno Haible.
9dnl Provide a working <error.h>.
10
11AC_DEFUN_ONCE([gl_ERROR_H],
12[
13 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
14
15 gl_CHECK_NEXT_HEADERS([error.h])
16 if test $ac_cv_header_error_h = yes; then
17 HAVE_ERROR_H=1
18 else
19 HAVE_ERROR_H=0
20 fi
21 AC_SUBST([HAVE_ERROR_H])
22
23 REPLACE_ERROR=0
24
25 gl_CHECK_FUNCS_ANDROID([error], [[#include <error.h>]])
26 if test $ac_cv_func_error = yes; then
27 HAVE_ERROR=1
28 else
29 HAVE_ERROR=0
30 case "$gl_cv_onwards_func_error" in
31 future*) REPLACE_ERROR=1 ;;
32 esac
33 fi
34
35 dnl We don't use AC_FUNC_ERROR_AT_LINE any more, because it is no longer
36 dnl maintained in Autoconf and because it invokes AC_LIBOBJ.
37 dnl We need to notice a missing declaration, like gl_CHECK_FUNCS_ANDROID does.
38 AC_CHECK_DECL([error_at_line], , , [[#include <error.h>]])
39 if test $ac_cv_have_decl_error_at_line = yes; then
40 AC_CACHE_CHECK([for error_at_line], [ac_cv_lib_error_at_line],
41 [AC_LINK_IFELSE(
42 [AC_LANG_PROGRAM(
43 [[#include <error.h>]],
44 [[error_at_line (0, 0, "", 0, "an error occurred");]])],
45 [ac_cv_lib_error_at_line=yes],
46 [ac_cv_lib_error_at_line=no])])
47 else
48 ac_cv_lib_error_at_line=no
49 fi
50 if test $ac_cv_lib_error_at_line = yes; then
51 HAVE_ERROR_AT_LINE=1
52 else
53 HAVE_ERROR_AT_LINE=0
54 fi
55 REPLACE_ERROR_AT_LINE=0
56
57 if test $ac_cv_func_error = yes && test $ac_cv_lib_error_at_line = yes; then
58 dnl On Android 11, when error_print_progname is set, the output of the
59 dnl error() function contains an extra space.
60 AC_CACHE_CHECK([for working error function],
61 [gl_cv_func_working_error],
62 [if test $cross_compiling != yes; then
63 AC_LINK_IFELSE(
64 [AC_LANG_PROGRAM([[
65 #include <error.h>
66 static void print_no_progname (void) {}
67 ]], [[
68 error_print_progname = print_no_progname;
69 error (0, 0, "foo");
70 ]])
71 ],
72 [rm -f conftest.out
73 if test -s conftest$ac_exeext \
74 && ./conftest$ac_exeext 2> conftest.out; then
75 if grep ' ' conftest.out >/dev/null; then
76 gl_cv_func_working_error=no
77 else
78 gl_cv_func_working_error=yes
79 fi
80 else
81 gl_cv_func_working_error=no
82 fi
83 rm -f conftest.out
84 ],
85 [gl_cv_func_working_error=no])
86 else
87 AC_COMPILE_IFELSE(
88 [AC_LANG_PROGRAM([[
89 #include <error.h>
90 ]], [[
91 error (0, 0, "foo");
92 ]])
93 ],
94 [case "$host_os" in
95 # Guess yes on glibc systems.
96 *-gnu* | gnu*) gl_cv_func_working_error="guessing yes" ;;
97 # Guess no on Android.
98 linux*-android*) gl_cv_func_working_error="guessing no" ;;
99 # If we don't know, obey --enable-cross-guesses.
100 *) gl_cv_func_working_error="$gl_cross_guess_normal" ;;
101 esac
102 ],
103 [gl_cv_func_working_error=no])
104 fi
105 ])
106 case "$gl_cv_func_working_error" in
107 *no)
108 REPLACE_ERROR=1
109 REPLACE_ERROR_AT_LINE=1
110 ;;
111 esac
112 fi
113
114 if test $HAVE_ERROR = 0 || test $REPLACE_ERROR = 1 \
115 || test $HAVE_ERROR_AT_LINE = 0 || test $REPLACE_ERROR_AT_LINE = 1; then
116 COMPILE_ERROR_C=1
117 else
118 COMPILE_ERROR_C=0
119 fi
120
121 AC_SUBST([HAVE_ERROR])
122 AC_SUBST([HAVE_ERROR_AT_LINE])
123 AC_SUBST([REPLACE_ERROR])
124 AC_SUBST([REPLACE_ERROR_AT_LINE])
125])
diff --git a/gl/m4/exponentd.m4 b/gl/m4/exponentd.m4
index 2ef46437..db597afc 100644
--- a/gl/m4/exponentd.m4
+++ b/gl/m4/exponentd.m4
@@ -1,9 +1,10 @@
1# exponentd.m4 serial 3 1# exponentd.m4
2dnl Copyright (C) 2007-2008, 2010-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2007-2008, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6AC_DEFUN([gl_DOUBLE_EXPONENT_LOCATION], 7AC_DEFUN_ONCE([gl_DOUBLE_EXPONENT_LOCATION],
7[ 8[
8 AC_CACHE_CHECK([where to find the exponent in a 'double'], 9 AC_CACHE_CHECK([where to find the exponent in a 'double'],
9 [gl_cv_cc_double_expbit0], 10 [gl_cv_cc_double_expbit0],
diff --git a/gl/m4/extensions.m4 b/gl/m4/extensions.m4
index 5336b8da..1fb68956 100644
--- a/gl/m4/extensions.m4
+++ b/gl/m4/extensions.m4
@@ -1,10 +1,11 @@
1# serial 23 -*- Autoconf -*- 1# extensions.m4
2# Enable extensions on systems that normally disable them. 2# serial 25 -*- Autoconf -*-
3dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
3 7
4# Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc. 8# Enable extensions on systems that normally disable them.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8 9
9dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that 10dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
10dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+. 11dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
@@ -229,4 +230,15 @@ AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
229 [Define to enable the declarations of ISO C 11 types and functions.]) 230 [Define to enable the declarations of ISO C 11 types and functions.])
230 ;; 231 ;;
231 esac 232 esac
233
234 dnl On OpenSolaris derivatives, the include files contains a couple of
235 dnl declarations that are only activated with an explicit
236 dnl -D__STDC_WANT_LIB_EXT1__.
237 AH_VERBATIM([USE_ISO_C_23_ANNEX_K_EXTENSIONS],
238[/* Define to enable the declarations of ISO C 23 Annex K types and functions. */
239#if !(defined __STDC_WANT_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__)
240#undef/**/__STDC_WANT_LIB_EXT1__
241#define __STDC_WANT_LIB_EXT1__ 1
242#endif
243])
232]) 244])
diff --git a/gl/m4/extern-inline.m4 b/gl/m4/extern-inline.m4
index c001b1cf..547da82a 100644
--- a/gl/m4/extern-inline.m4
+++ b/gl/m4/extern-inline.m4
@@ -1,10 +1,12 @@
1dnl 'extern inline' a la ISO C99. 1# extern-inline.m4
2 2# serial 1
3dnl Copyright 2012-2023 Free Software Foundation, Inc. 3dnl Copyright 2012-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl 'extern inline' a la ISO C99.
9
8AC_DEFUN([gl_EXTERN_INLINE], 10AC_DEFUN([gl_EXTERN_INLINE],
9[ 11[
10 AC_CACHE_CHECK([whether ctype.h defines __header_inline], 12 AC_CACHE_CHECK([whether ctype.h defines __header_inline],
@@ -79,7 +81,8 @@ AC_DEFUN([gl_EXTERN_INLINE],
79# define _GL_EXTERN_INLINE_STDHEADER_BUG 81# define _GL_EXTERN_INLINE_STDHEADER_BUG
80#endif 82#endif
81#if ((__GNUC__ \ 83#if ((__GNUC__ \
82 ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \ 84 ? (defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
85 && !defined __PCC__) \
83 : (199901L <= __STDC_VERSION__ \ 86 : (199901L <= __STDC_VERSION__ \
84 && !defined __HP_cc \ 87 && !defined __HP_cc \
85 && !defined __PGI \ 88 && !defined __PGI \
@@ -89,6 +92,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
89# define _GL_EXTERN_INLINE extern inline 92# define _GL_EXTERN_INLINE extern inline
90# define _GL_EXTERN_INLINE_IN_USE 93# define _GL_EXTERN_INLINE_IN_USE
91#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \ 94#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
95 && !defined __PCC__ \
92 && !defined _GL_EXTERN_INLINE_STDHEADER_BUG) 96 && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
93# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__ 97# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
94 /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */ 98 /* __gnu_inline__ suppresses a GCC 4.2 diagnostic. */
diff --git a/gl/m4/fclose.m4 b/gl/m4/fclose.m4
new file mode 100644
index 00000000..0c1358ed
--- /dev/null
+++ b/gl/m4/fclose.m4
@@ -0,0 +1,99 @@
1# fclose.m4
2# serial 12
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN_ONCE([gl_FUNC_FCLOSE],
9[
10 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
11 AC_REQUIRE([AC_CANONICAL_HOST])
12
13 gl_FUNC_FFLUSH_STDIN
14 case "$gl_cv_func_fflush_stdin" in
15 *yes) ;;
16 *) REPLACE_FCLOSE=1 ;;
17 esac
18
19 AC_REQUIRE([gl_FUNC_CLOSE])
20 if test $REPLACE_CLOSE = 1; then
21 REPLACE_FCLOSE=1
22 fi
23
24 case "$host_os" in
25 openedition) REPLACE_FCLOSE=1 ;;
26 esac
27
28 if test $REPLACE_FCLOSE = 0; then
29 gl_FUNC_FCLOSE_STDIN
30 case "$gl_cv_func_fclose_stdin" in
31 *yes) ;;
32 *) REPLACE_FCLOSE=1 ;;
33 esac
34 fi
35])
36
37dnl Determine whether fclose works on input streams.
38dnl Sets gl_cv_func_fclose_stdin.
39
40AC_DEFUN([gl_FUNC_FCLOSE_STDIN],
41[
42 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
43 AC_CHECK_HEADERS_ONCE([unistd.h])
44 AC_CACHE_CHECK([whether fclose works on input streams],
45 [gl_cv_func_fclose_stdin],
46 [echo hello world > conftest.txt
47 AC_RUN_IFELSE(
48 [AC_LANG_PROGRAM(
49 [[#include <fcntl.h>
50 #include <stdio.h>
51 #if HAVE_UNISTD_H
52 # include <unistd.h>
53 #else /* on Windows with MSVC */
54 # include <io.h>
55 #endif
56 ]GL_MDA_DEFINES],
57 [[int fd;
58 int fd2;
59 FILE *fp;
60 fd = open ("conftest.txt", O_RDONLY);
61 if (fd < 0)
62 return 1;
63 if (lseek (fd, 1, SEEK_SET) != 1)
64 return 2;
65 fd2 = dup (fd);
66 if (fd2 < 0)
67 return 3;
68 fp = fdopen (fd2, "r");
69 if (fp == NULL)
70 return 4;
71 if (fgetc (fp) != 'e')
72 { fclose (fp); return 5; }
73 /* This fclose() call should reposition the underlying file
74 descriptor. */
75 if (fclose (fp) != 0)
76 return 6;
77 if (lseek (fd2, 0, SEEK_CUR) != -1) /* should fail with EBADF */
78 return 7;
79 /* Verify the file position. */
80 if (lseek (fd, 0, SEEK_CUR) != 2)
81 return 8;
82 return 0;
83 ]])],
84 [gl_cv_func_fclose_stdin=yes],
85 [gl_cv_func_fclose_stdin=no],
86 [case "$host_os" in
87 # Guess no on glibc systems.
88 *-gnu* | gnu*) gl_cv_func_fclose_stdin="guessing no" ;;
89 # Guess yes on musl systems.
90 *-musl* | midipix*) gl_cv_func_fclose_stdin="guessing yes" ;;
91 # Guess no on native Windows.
92 mingw* | windows*) gl_cv_func_fclose_stdin="guessing no" ;;
93 # If we don't know, obey --enable-cross-guesses.
94 *) gl_cv_func_fclose_stdin="$gl_cross_guess_normal" ;;
95 esac
96 ])
97 rm conftest.txt
98 ])
99])
diff --git a/gl/m4/fcntl-o.m4 b/gl/m4/fcntl-o.m4
index 59d558bd..43aa1325 100644
--- a/gl/m4/fcntl-o.m4
+++ b/gl/m4/fcntl-o.m4
@@ -1,5 +1,6 @@
1# fcntl-o.m4 serial 7 1# fcntl-o.m4
2dnl Copyright (C) 2006, 2009-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -117,9 +118,9 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
117 *) gl_cv_header_working_fcntl_h='no';; 118 *) gl_cv_header_working_fcntl_h='no';;
118 esac], 119 esac],
119 [case "$host_os" in 120 [case "$host_os" in
120 # Guess 'no' on native Windows. 121 # Guess 'no' on native Windows.
121 mingw*) gl_cv_header_working_fcntl_h='no' ;; 122 mingw* | windows*) gl_cv_header_working_fcntl_h='no' ;;
122 *) gl_cv_header_working_fcntl_h=cross-compiling ;; 123 *) gl_cv_header_working_fcntl_h=cross-compiling ;;
123 esac 124 esac
124 ]) 125 ])
125 ]) 126 ])
diff --git a/gl/m4/fcntl.m4 b/gl/m4/fcntl.m4
index 524a99af..f6d0f377 100644
--- a/gl/m4/fcntl.m4
+++ b/gl/m4/fcntl.m4
@@ -1,5 +1,6 @@
1# fcntl.m4 serial 11 1# fcntl.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -82,7 +83,7 @@ AC_DEFUN([gl_FUNC_FCNTL],
82 esac 83 esac
83 84
84 dnl Many systems lack F_DUPFD_CLOEXEC. 85 dnl Many systems lack F_DUPFD_CLOEXEC.
85 dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD. 86 dnl NetBSD 10.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
86 AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC], 87 AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
87 [gl_cv_func_fcntl_f_dupfd_cloexec], 88 [gl_cv_func_fcntl_f_dupfd_cloexec],
88 [AC_RUN_IFELSE( 89 [AC_RUN_IFELSE(
diff --git a/gl/m4/fcntl_h.m4 b/gl/m4/fcntl_h.m4
index 68f4e648..b69f7a0c 100644
--- a/gl/m4/fcntl_h.m4
+++ b/gl/m4/fcntl_h.m4
@@ -1,10 +1,12 @@
1# fcntl_h.m4
1# serial 20 2# serial 20
2# Configure fcntl.h. 3dnl Copyright (C) 2006-2007, 2009-2024 Free Software Foundation, Inc.
3dnl Copyright (C) 2006-2007, 2009-2023 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# Configure fcntl.h.
9
8dnl Written by Paul Eggert. 10dnl Written by Paul Eggert.
9 11
10AC_DEFUN_ONCE([gl_FCNTL_H], 12AC_DEFUN_ONCE([gl_FCNTL_H],
diff --git a/gl/m4/fflush.m4 b/gl/m4/fflush.m4
index 3e3c8903..43fc3bf3 100644
--- a/gl/m4/fflush.m4
+++ b/gl/m4/fflush.m4
@@ -1,9 +1,9 @@
1# fflush.m4 serial 18 1# fflush.m4
2 2# serial 19
3# Copyright (C) 2007-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl From Eric Blake 8dnl From Eric Blake
9 9
@@ -79,9 +79,9 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
79 [gl_cv_func_fflush_stdin=yes], 79 [gl_cv_func_fflush_stdin=yes],
80 [gl_cv_func_fflush_stdin=no], 80 [gl_cv_func_fflush_stdin=no],
81 [case "$host_os" in 81 [case "$host_os" in
82 # Guess no on native Windows. 82 # Guess no on native Windows.
83 mingw*) gl_cv_func_fflush_stdin="guessing no" ;; 83 mingw* | windows*) gl_cv_func_fflush_stdin="guessing no" ;;
84 *) gl_cv_func_fflush_stdin=cross ;; 84 *) gl_cv_func_fflush_stdin=cross ;;
85 esac 85 esac
86 ]) 86 ])
87 rm conftest.txt 87 rm conftest.txt
diff --git a/gl/m4/float_h.m4 b/gl/m4/float_h.m4
index 2f0c9c4e..c95d4171 100644
--- a/gl/m4/float_h.m4
+++ b/gl/m4/float_h.m4
@@ -1,5 +1,6 @@
1# float_h.m4 serial 13 1# float_h.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -84,9 +85,11 @@ int main ()
84 [gl_cv_func_itold_works="guessing no"], 85 [gl_cv_func_itold_works="guessing no"],
85 [gl_cv_func_itold_works="guessing yes"]) 86 [gl_cv_func_itold_works="guessing yes"])
86 ;; 87 ;;
87 # Guess yes on native Windows. 88 # Guess yes on native Windows.
88 mingw*) gl_cv_func_itold_works="guessing yes" ;; 89 mingw* | windows*)
89 *) gl_cv_func_itold_works="guessing yes" ;; 90 gl_cv_func_itold_works="guessing yes" ;;
91 *)
92 gl_cv_func_itold_works="guessing yes" ;;
90 esac 93 esac
91 ]) 94 ])
92 ]) 95 ])
diff --git a/gl/m4/floorf.m4 b/gl/m4/floorf.m4
index c49ffa6b..2572c848 100644
--- a/gl/m4/floorf.m4
+++ b/gl/m4/floorf.m4
@@ -1,5 +1,6 @@
1# floorf.m4 serial 18 1# floorf.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 21
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -26,7 +27,7 @@ AC_DEFUN([gl_FUNC_FLOORF],
26 AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559], 27 AC_CACHE_CHECK([whether floorf works according to ISO C 99 with IEC 60559],
27 [gl_cv_func_floorf_ieee], 28 [gl_cv_func_floorf_ieee],
28 [ 29 [
29 save_LIBS="$LIBS" 30 saved_LIBS="$LIBS"
30 LIBS="$LIBS $FLOORF_LIBM" 31 LIBS="$LIBS $FLOORF_LIBM"
31 AC_RUN_IFELSE( 32 AC_RUN_IFELSE(
32 [AC_LANG_SOURCE([[ 33 [AC_LANG_SOURCE([[
@@ -49,17 +50,17 @@ int main (int argc, char *argv[])
49 [gl_cv_func_floorf_ieee=yes], 50 [gl_cv_func_floorf_ieee=yes],
50 [gl_cv_func_floorf_ieee=no], 51 [gl_cv_func_floorf_ieee=no],
51 [case "$host_os" in 52 [case "$host_os" in
52 # Guess yes on glibc systems. 53 # Guess yes on glibc systems.
53 *-gnu* | gnu*) gl_cv_func_floorf_ieee="guessing yes" ;; 54 *-gnu* | gnu*) gl_cv_func_floorf_ieee="guessing yes" ;;
54 # Guess yes on musl systems. 55 # Guess yes on musl systems.
55 *-musl*) gl_cv_func_floorf_ieee="guessing yes" ;; 56 *-musl* | midipix*) gl_cv_func_floorf_ieee="guessing yes" ;;
56 # Guess yes on native Windows. 57 # Guess yes on native Windows.
57 mingw*) gl_cv_func_floorf_ieee="guessing yes" ;; 58 mingw* | windows*) gl_cv_func_floorf_ieee="guessing yes" ;;
58 # If we don't know, obey --enable-cross-guesses. 59 # If we don't know, obey --enable-cross-guesses.
59 *) gl_cv_func_floorf_ieee="$gl_cross_guess_normal" ;; 60 *) gl_cv_func_floorf_ieee="$gl_cross_guess_normal" ;;
60 esac 61 esac
61 ]) 62 ])
62 LIBS="$save_LIBS" 63 LIBS="$saved_LIBS"
63 ]) 64 ])
64 case "$gl_cv_func_floorf_ieee" in 65 case "$gl_cv_func_floorf_ieee" in
65 *yes) ;; 66 *yes) ;;
@@ -94,7 +95,7 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
94 [[x = funcptr(x) + floorf(x);]])], 95 [[x = funcptr(x) + floorf(x);]])],
95 [gl_cv_func_floorf_libm=]) 96 [gl_cv_func_floorf_libm=])
96 if test "$gl_cv_func_floorf_libm" = "?"; then 97 if test "$gl_cv_func_floorf_libm" = "?"; then
97 save_LIBS="$LIBS" 98 saved_LIBS="$LIBS"
98 LIBS="$LIBS -lm" 99 LIBS="$LIBS -lm"
99 AC_LINK_IFELSE( 100 AC_LINK_IFELSE(
100 [AC_LANG_PROGRAM( 101 [AC_LANG_PROGRAM(
@@ -106,7 +107,7 @@ AC_DEFUN([gl_FUNC_FLOORF_LIBS],
106 float x;]], 107 float x;]],
107 [[x = funcptr(x) + floorf(x);]])], 108 [[x = funcptr(x) + floorf(x);]])],
108 [gl_cv_func_floorf_libm="-lm"]) 109 [gl_cv_func_floorf_libm="-lm"])
109 LIBS="$save_LIBS" 110 LIBS="$saved_LIBS"
110 fi 111 fi
111 ]) 112 ])
112 FLOORF_LIBM="$gl_cv_func_floorf_libm" 113 FLOORF_LIBM="$gl_cv_func_floorf_libm"
diff --git a/gl/m4/fopen.m4 b/gl/m4/fopen.m4
index 9c39ff72..f3b7aadd 100644
--- a/gl/m4/fopen.m4
+++ b/gl/m4/fopen.m4
@@ -1,15 +1,16 @@
1# fopen.m4 serial 13 1# fopen.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6 7
7AC_DEFUN([gl_FUNC_FOPEN], 8AC_DEFUN([gl_FUNC_FOPEN_ITSELF],
8[ 9[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 10 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
10 AC_REQUIRE([AC_CANONICAL_HOST]) 11 AC_REQUIRE([AC_CANONICAL_HOST])
11 case "$host_os" in 12 case "$host_os" in
12 mingw* | pw*) 13 mingw* | windows* | pw*)
13 dnl Replace fopen, for handling of "/dev/null". 14 dnl Replace fopen, for handling of "/dev/null".
14 REPLACE_FOPEN=1 15 REPLACE_FOPEN=1
15 dnl fopen on mingw also has the trailing slash bug. 16 dnl fopen on mingw also has the trailing slash bug.
@@ -58,6 +59,15 @@ changequote([,])dnl
58 esac 59 esac
59]) 60])
60 61
62AC_DEFUN([gl_FUNC_FOPEN],
63[
64 AC_REQUIRE([gl_FUNC_FOPEN_ITSELF])
65 AC_REQUIRE([gl_FUNC_FCLOSE])
66 if test $REPLACE_FCLOSE = 1; then
67 REPLACE_FOPEN=1
68 fi
69])
70
61AC_DEFUN([gl_FUNC_FOPEN_GNU], 71AC_DEFUN([gl_FUNC_FOPEN_GNU],
62[ 72[
63 AC_REQUIRE([gl_FUNC_FOPEN]) 73 AC_REQUIRE([gl_FUNC_FOPEN])
@@ -87,7 +97,7 @@ int main ()
87 [gl_cv_func_fopen_mode_x=no], 97 [gl_cv_func_fopen_mode_x=no],
88 [case "$host_os" in 98 [case "$host_os" in
89 # Guess yes on glibc and musl systems. 99 # Guess yes on glibc and musl systems.
90 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) 100 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*)
91 gl_cv_func_fopen_mode_x="guessing yes" ;; 101 gl_cv_func_fopen_mode_x="guessing yes" ;;
92 # If we don't know, obey --enable-cross-guesses. 102 # If we don't know, obey --enable-cross-guesses.
93 *) 103 *)
@@ -124,10 +134,10 @@ int main ()
124 [gl_cv_func_fopen_mode_e=no], 134 [gl_cv_func_fopen_mode_e=no],
125 [case "$host_os" in 135 [case "$host_os" in
126 # Guess yes on glibc and musl systems. 136 # Guess yes on glibc and musl systems.
127 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*) 137 linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl* | midipix*)
128 gl_cv_func_fopen_mode_e="guessing yes" ;; 138 gl_cv_func_fopen_mode_e="guessing yes" ;;
129 # Guess no on native Windows. 139 # Guess no on native Windows.
130 mingw*) 140 mingw* | windows*)
131 gl_cv_func_fopen_mode_e="guessing no" ;; 141 gl_cv_func_fopen_mode_e="guessing no" ;;
132 # If we don't know, obey --enable-cross-guesses. 142 # If we don't know, obey --enable-cross-guesses.
133 *) 143 *)
diff --git a/gl/m4/fpurge.m4 b/gl/m4/fpurge.m4
index b365409d..a77f5b96 100644
--- a/gl/m4/fpurge.m4
+++ b/gl/m4/fpurge.m4
@@ -1,5 +1,6 @@
1# fpurge.m4 serial 12 1# fpurge.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +11,7 @@ AC_DEFUN([gl_FUNC_FPURGE],
10 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 11 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 AC_CHECK_HEADERS_ONCE([stdio_ext.h]) 12 AC_CHECK_HEADERS_ONCE([stdio_ext.h])
12 AC_CHECK_FUNCS_ONCE([fpurge]) 13 AC_CHECK_FUNCS_ONCE([fpurge])
13 AC_CHECK_FUNCS_ONCE([__fpurge]) 14 gl_CHECK_FUNCS_ANDROID([__fpurge], [[#include <stdio_ext.h>]])
14 AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]]) 15 AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
15 if test "x$ac_cv_func_fpurge" = xyes; then 16 if test "x$ac_cv_func_fpurge" = xyes; then
16 HAVE_FPURGE=1 17 HAVE_FPURGE=1
@@ -53,10 +54,10 @@ AC_DEFUN([gl_FUNC_FPURGE],
53 [gl_cv_func_fpurge_works=yes], 54 [gl_cv_func_fpurge_works=yes],
54 [gl_cv_func_fpurge_works=no], 55 [gl_cv_func_fpurge_works=no],
55 [case "$host_os" in 56 [case "$host_os" in
56 # Guess yes on musl systems. 57 # Guess yes on musl systems.
57 *-musl*) gl_cv_func_fpurge_works="guessing yes" ;; 58 *-musl* | midipix*) gl_cv_func_fpurge_works="guessing yes" ;;
58 # Otherwise obey --enable-cross-guesses. 59 # Otherwise obey --enable-cross-guesses.
59 *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;; 60 *) gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
60 esac 61 esac
61 ]) 62 ])
62 ]) 63 ])
diff --git a/gl/m4/freading.m4 b/gl/m4/freading.m4
index 35333369..be899456 100644
--- a/gl/m4/freading.m4
+++ b/gl/m4/freading.m4
@@ -1,5 +1,6 @@
1# freading.m4 serial 2 1# freading.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -7,5 +8,8 @@ dnl with or without modifications, as long as this notice is preserved.
7AC_DEFUN([gl_FUNC_FREADING], 8AC_DEFUN([gl_FUNC_FREADING],
8[ 9[
9 AC_CHECK_HEADERS_ONCE([stdio_ext.h]) 10 AC_CHECK_HEADERS_ONCE([stdio_ext.h])
10 AC_CHECK_FUNCS_ONCE([__freading]) 11 gl_CHECK_FUNCS_ANDROID([__freading],
12 [[#include <stdio.h>
13 #include <stdio_ext.h>
14 ]])
11]) 15])
diff --git a/gl/m4/free.m4 b/gl/m4/free.m4
index 0389dea3..a2b596d6 100644
--- a/gl/m4/free.m4
+++ b/gl/m4/free.m4
@@ -1,8 +1,9 @@
1# free.m4 serial 6 1# free.m4
2# Copyright (C) 2003-2005, 2009-2023 Free Software Foundation, Inc. 2# serial 6
3# This file is free software; the Free Software Foundation 3dnl Copyright (C) 2003-2005, 2009-2024 Free Software Foundation, Inc.
4# gives unlimited permission to copy and/or distribute it, 4dnl This file is free software; the Free Software Foundation
5# with or without modifications, as long as this notice is preserved. 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
6 7
7# Written by Paul Eggert and Bruno Haible. 8# Written by Paul Eggert and Bruno Haible.
8 9
diff --git a/gl/m4/fseek.m4 b/gl/m4/fseek.m4
index c5fe688c..fb220a1f 100644
--- a/gl/m4/fseek.m4
+++ b/gl/m4/fseek.m4
@@ -1,5 +1,6 @@
1# fseek.m4 serial 4 1# fseek.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fseeko.m4 b/gl/m4/fseeko.m4
index 05ee06bc..5682a1f2 100644
--- a/gl/m4/fseeko.m4
+++ b/gl/m4/fseeko.m4
@@ -1,5 +1,6 @@
1# fseeko.m4 serial 20 1# fseeko.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 20
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/fstat.m4 b/gl/m4/fstat.m4
index 7cb2edb0..47777b0c 100644
--- a/gl/m4/fstat.m4
+++ b/gl/m4/fstat.m4
@@ -1,5 +1,6 @@
1# fstat.m4 serial 8 1# fstat.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 10
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -10,10 +11,10 @@ AC_DEFUN([gl_FUNC_FSTAT],
10 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) 11 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
11 12
12 case "$host_os" in 13 case "$host_os" in
13 mingw* | solaris*) 14 darwin* | mingw* | windows* | solaris*)
15 dnl macOS and Solaris stat can return a negative tv_nsec.
14 dnl On MinGW, the original stat() returns st_atime, st_mtime, 16 dnl On MinGW, the original stat() returns st_atime, st_mtime,
15 dnl st_ctime values that are affected by the time zone. 17 dnl st_ctime values that are affected by the time zone.
16 dnl Solaris stat can return a negative tv_nsec.
17 REPLACE_FSTAT=1 18 REPLACE_FSTAT=1
18 ;; 19 ;;
19 esac 20 esac
diff --git a/gl/m4/fstypename.m4 b/gl/m4/fstypename.m4
index f65c459f..05a68805 100644
--- a/gl/m4/fstypename.m4
+++ b/gl/m4/fstypename.m4
@@ -1,4 +1,10 @@
1#serial 6 1# fstypename.m4
2# serial 6
3dnl Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2024 Free Software
4dnl Foundation, Inc.
5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved.
2 8
3dnl From Jim Meyering. 9dnl From Jim Meyering.
4dnl 10dnl
@@ -6,12 +12,6 @@ dnl See if struct statfs has the f_fstypename member.
6dnl If so, define HAVE_STRUCT_STATFS_F_FSTYPENAME. 12dnl If so, define HAVE_STRUCT_STATFS_F_FSTYPENAME.
7dnl 13dnl
8 14
9# Copyright (C) 1998-1999, 2001, 2004, 2006, 2009-2023 Free Software
10# Foundation, Inc.
11# This file is free software; the Free Software Foundation
12# gives unlimited permission to copy and/or distribute it,
13# with or without modifications, as long as this notice is preserved.
14
15AC_DEFUN([gl_FSTYPENAME], 15AC_DEFUN([gl_FSTYPENAME],
16[ 16[
17 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,, 17 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,
diff --git a/gl/m4/fsusage.m4 b/gl/m4/fsusage.m4
index 88f3ca81..1ce90660 100644
--- a/gl/m4/fsusage.m4
+++ b/gl/m4/fsusage.m4
@@ -1,11 +1,11 @@
1# fsusage.m4
1# serial 35 2# serial 35
2# Obtaining file system usage information. 3dnl Copyright (C) 1997-1998, 2000-2001, 2003-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
3 7
4# Copyright (C) 1997-1998, 2000-2001, 2003-2023 Free Software Foundation, Inc. 8# Obtaining file system usage information.
5#
6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9 9
10# Written by Jim Meyering. 10# Written by Jim Meyering.
11 11
@@ -269,7 +269,7 @@ int check_f_blocks_size[sizeof fsd.f_blocks * CHAR_BIT <= 32 ? -1 : 1];
269 269
270# Check for SunOS statfs brokenness wrt partitions 2GB and larger. 270# Check for SunOS statfs brokenness wrt partitions 2GB and larger.
271# If <sys/vfs.h> exists and struct statfs has a member named f_spare, 271# If <sys/vfs.h> exists and struct statfs has a member named f_spare,
272# enable the work-around code in fsusage.c. 272# enable the workaround code in fsusage.c.
273AC_DEFUN([gl_STATFS_TRUNCATES], 273AC_DEFUN([gl_STATFS_TRUNCATES],
274[ 274[
275 AC_CACHE_CHECK([for statfs that truncates block counts], 275 AC_CACHE_CHECK([for statfs that truncates block counts],
diff --git a/gl/m4/ftell.m4 b/gl/m4/ftell.m4
index 79f1aaf2..ab10736b 100644
--- a/gl/m4/ftell.m4
+++ b/gl/m4/ftell.m4
@@ -1,5 +1,6 @@
1# ftell.m4 serial 3 1# ftell.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ftello.m4 b/gl/m4/ftello.m4
index 4901b168..0eb8fa0d 100644
--- a/gl/m4/ftello.m4
+++ b/gl/m4/ftello.m4
@@ -1,5 +1,6 @@
1# ftello.m4 serial 14 1# ftello.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -37,13 +38,24 @@ AC_DEFUN([gl_FUNC_FTELLO],
37 if test $gl_cv_var_stdin_large_offset = no; then 38 if test $gl_cv_var_stdin_large_offset = no; then
38 REPLACE_FTELLO=1 39 REPLACE_FTELLO=1
39 fi 40 fi
41 AC_REQUIRE([AC_CANONICAL_HOST])
42 if test $REPLACE_FTELLO = 0; then
43 dnl On native Windows, in some circumstances, ftell(), ftello(),
44 dnl fgetpos(), lseek(), _lseeki64() all succeed on devices of type
45 dnl FILE_TYPE_PIPE. However, to match POSIX behaviour, we want
46 dnl ftell(), ftello(), fgetpos(), lseek() to fail when the argument fd
47 dnl designates a pipe. See also
48 dnl https://github.com/python/cpython/issues/78961#issuecomment-1093800325
49 case "$host_os" in
50 mingw* | windows*) REPLACE_FTELLO=1 ;;
51 esac
52 fi
40 if test $REPLACE_FTELLO = 0; then 53 if test $REPLACE_FTELLO = 0; then
41 dnl Detect bug on Solaris. 54 dnl Detect bug on Solaris.
42 dnl ftell and ftello produce incorrect results after putc that followed a 55 dnl ftell and ftello produce incorrect results after putc that followed a
43 dnl getc call that reached EOF on Solaris. This is because the _IOREAD 56 dnl getc call that reached EOF on Solaris. This is because the _IOREAD
44 dnl flag does not get cleared in this case, even though _IOWRT gets set, 57 dnl flag does not get cleared in this case, even though _IOWRT gets set,
45 dnl and ftell and ftello look whether the _IOREAD flag is set. 58 dnl and ftell and ftello look whether the _IOREAD flag is set.
46 AC_REQUIRE([AC_CANONICAL_HOST])
47 AC_CACHE_CHECK([whether ftello works], 59 AC_CACHE_CHECK([whether ftello works],
48 [gl_cv_func_ftello_works], 60 [gl_cv_func_ftello_works],
49 [ 61 [
@@ -51,12 +63,12 @@ AC_DEFUN([gl_FUNC_FTELLO],
51 dnl be opened. 63 dnl be opened.
52changequote(,)dnl 64changequote(,)dnl
53 case "$host_os" in 65 case "$host_os" in
54 # Guess no on Solaris. 66 # Guess no on Solaris.
55 solaris*) gl_cv_func_ftello_works="guessing no" ;; 67 solaris*) gl_cv_func_ftello_works="guessing no" ;;
56 # Guess yes on native Windows. 68 # Guess yes on native Windows.
57 mingw*) gl_cv_func_ftello_works="guessing yes" ;; 69 mingw* | windows*) gl_cv_func_ftello_works="guessing yes" ;;
58 # Guess yes otherwise. 70 # Guess yes otherwise.
59 *) gl_cv_func_ftello_works="guessing yes" ;; 71 *) gl_cv_func_ftello_works="guessing yes" ;;
60 esac 72 esac
61changequote([,])dnl 73changequote([,])dnl
62 AC_RUN_IFELSE( 74 AC_RUN_IFELSE(
diff --git a/gl/m4/getaddrinfo.m4 b/gl/m4/getaddrinfo.m4
index 15f09ffb..8e209177 100644
--- a/gl/m4/getaddrinfo.m4
+++ b/gl/m4/getaddrinfo.m4
@@ -1,5 +1,6 @@
1# getaddrinfo.m4 serial 34 1# getaddrinfo.m4
2dnl Copyright (C) 2004-2023 Free Software Foundation, Inc. 2# serial 35
3dnl Copyright (C) 2004-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -41,7 +42,7 @@ AC_DEFUN([gl_GETADDRINFO],
41 AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32], 42 AC_CACHE_CHECK([for getaddrinfo in ws2tcpip.h and -lws2_32],
42 gl_cv_w32_getaddrinfo, [ 43 gl_cv_w32_getaddrinfo, [
43 gl_cv_w32_getaddrinfo=no 44 gl_cv_w32_getaddrinfo=no
44 am_save_LIBS="$LIBS" 45 gl_saved_LIBS="$LIBS"
45 LIBS="$LIBS -lws2_32" 46 LIBS="$LIBS -lws2_32"
46 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 47 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
47#ifdef HAVE_WS2TCPIP_H 48#ifdef HAVE_WS2TCPIP_H
@@ -49,7 +50,7 @@ AC_DEFUN([gl_GETADDRINFO],
49#endif 50#endif
50#include <stddef.h> 51#include <stddef.h>
51]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes]) 52]], [[getaddrinfo(NULL, NULL, NULL, NULL);]])], [gl_cv_w32_getaddrinfo=yes])
52 LIBS="$am_save_LIBS" 53 LIBS="$gl_saved_LIBS"
53 ]) 54 ])
54 if test "$gl_cv_w32_getaddrinfo" = "yes"; then 55 if test "$gl_cv_w32_getaddrinfo" = "yes"; then
55 GETADDRINFO_LIB="-lws2_32" 56 GETADDRINFO_LIB="-lws2_32"
diff --git a/gl/m4/getdelim.m4 b/gl/m4/getdelim.m4
index 9aaed202..61139039 100644
--- a/gl/m4/getdelim.m4
+++ b/gl/m4/getdelim.m4
@@ -1,6 +1,7 @@
1# getdelim.m4 serial 16 1# getdelim.m4
2# serial 19
2 3
3dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. 4dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
4dnl 5dnl
5dnl This file is free software; the Free Software Foundation 6dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it, 7dnl gives unlimited permission to copy and/or distribute it,
@@ -18,7 +19,7 @@ AC_DEFUN([gl_FUNC_GETDELIM],
18 19
19 AC_CHECK_DECLS_ONCE([getdelim]) 20 AC_CHECK_DECLS_ONCE([getdelim])
20 21
21 AC_CHECK_FUNCS_ONCE([getdelim]) 22 gl_CHECK_FUNCS_ANDROID([getdelim], [[#include <stdio.h>]])
22 if test $ac_cv_func_getdelim = yes; then 23 if test $ac_cv_func_getdelim = yes; then
23 HAVE_GETDELIM=1 24 HAVE_GETDELIM=1
24 dnl Found it in some library. Verify that it works. 25 dnl Found it in some library. Verify that it works.
@@ -82,8 +83,8 @@ AC_DEFUN([gl_FUNC_GETDELIM],
82 ], 83 ],
83 [gl_cv_func_working_getdelim="guessing yes"], 84 [gl_cv_func_working_getdelim="guessing yes"],
84 [case "$host_os" in 85 [case "$host_os" in
85 *-musl*) gl_cv_func_working_getdelim="guessing yes" ;; 86 *-musl* | midipix*) gl_cv_func_working_getdelim="guessing yes" ;;
86 *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;; 87 *) gl_cv_func_working_getdelim="$gl_cross_guess_normal" ;;
87 esac 88 esac
88 ]) 89 ])
89 ]) 90 ])
@@ -96,6 +97,9 @@ AC_DEFUN([gl_FUNC_GETDELIM],
96 esac 97 esac
97 else 98 else
98 HAVE_GETDELIM=0 99 HAVE_GETDELIM=0
100 case "$gl_cv_onwards_func_getdelim" in
101 future*) REPLACE_GETDELIM=1 ;;
102 esac
99 fi 103 fi
100 104
101 if test $ac_cv_have_decl_getdelim = no; then 105 if test $ac_cv_have_decl_getdelim = no; then
diff --git a/gl/m4/getdtablesize.m4 b/gl/m4/getdtablesize.m4
index 8bcda905..aaefe9b2 100644
--- a/gl/m4/getdtablesize.m4
+++ b/gl/m4/getdtablesize.m4
@@ -1,5 +1,6 @@
1# getdtablesize.m4 serial 8 1# getdtablesize.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/gethostname.m4 b/gl/m4/gethostname.m4
index 63f5f636..2f743b7d 100644
--- a/gl/m4/gethostname.m4
+++ b/gl/m4/gethostname.m4
@@ -1,5 +1,6 @@
1# gethostname.m4 serial 15 1# gethostname.m4
2dnl Copyright (C) 2002, 2008-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2002, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -20,7 +21,7 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME],
20 AC_CACHE_CHECK([for gethostname in winsock2.h and -lws2_32], 21 AC_CACHE_CHECK([for gethostname in winsock2.h and -lws2_32],
21 [gl_cv_w32_gethostname], 22 [gl_cv_w32_gethostname],
22 [gl_cv_w32_gethostname=no 23 [gl_cv_w32_gethostname=no
23 gl_save_LIBS="$LIBS" 24 gl_saved_LIBS="$LIBS"
24 LIBS="$LIBS -lws2_32" 25 LIBS="$LIBS -lws2_32"
25 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ 26 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
26#ifdef HAVE_WINSOCK2_H 27#ifdef HAVE_WINSOCK2_H
@@ -28,7 +29,7 @@ AC_DEFUN([gl_FUNC_GETHOSTNAME],
28#endif 29#endif
29#include <stddef.h> 30#include <stddef.h>
30]], [[gethostname(NULL, 0);]])], [gl_cv_w32_gethostname=yes]) 31]], [[gethostname(NULL, 0);]])], [gl_cv_w32_gethostname=yes])
31 LIBS="$gl_save_LIBS" 32 LIBS="$gl_saved_LIBS"
32 ]) 33 ])
33 if test "$gl_cv_w32_gethostname" = "yes"; then 34 if test "$gl_cv_w32_gethostname" = "yes"; then
34 GETHOSTNAME_LIB="-lws2_32" 35 GETHOSTNAME_LIB="-lws2_32"
diff --git a/gl/m4/getline.m4 b/gl/m4/getline.m4
index 03569f06..36513cd4 100644
--- a/gl/m4/getline.m4
+++ b/gl/m4/getline.m4
@@ -1,6 +1,7 @@
1# getline.m4 serial 30 1# getline.m4
2# serial 33
2 3
3dnl Copyright (C) 1998-2003, 2005-2007, 2009-2023 Free Software Foundation, 4dnl Copyright (C) 1998-2003, 2005-2007, 2009-2024 Free Software Foundation,
4dnl Inc. 5dnl Inc.
5dnl 6dnl
6dnl This file is free software; the Free Software Foundation 7dnl This file is free software; the Free Software Foundation
@@ -23,12 +24,9 @@ AC_DEFUN([gl_FUNC_GETLINE],
23 24
24 AC_CHECK_DECLS_ONCE([getline]) 25 AC_CHECK_DECLS_ONCE([getline])
25 26
26 gl_getline_needs_run_time_check=no 27 gl_CHECK_FUNCS_ANDROID([getline], [[#include <stdio.h>]])
27 AC_CHECK_FUNC([getline], 28 if test $ac_cv_func_getline = yes; then
28 [dnl Found it in some library. Verify that it works. 29 dnl Found it in some library. Verify that it works.
29 gl_getline_needs_run_time_check=yes],
30 [am_cv_func_working_getline=no])
31 if test $gl_getline_needs_run_time_check = yes; then
32 AC_CACHE_CHECK([for working getline function], 30 AC_CACHE_CHECK([for working getline function],
33 [am_cv_func_working_getline], 31 [am_cv_func_working_getline],
34 [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data 32 [echo fooNbarN | tr -d '\012' | tr N '\012' > conftest.data
@@ -79,12 +77,17 @@ AC_DEFUN([gl_FUNC_GETLINE],
79 ], 77 ],
80 [am_cv_func_working_getline="guessing yes"], 78 [am_cv_func_working_getline="guessing yes"],
81 [case "$host_os" in 79 [case "$host_os" in
82 *-musl*) am_cv_func_working_getline="guessing yes" ;; 80 *-musl* | midipix*) am_cv_func_working_getline="guessing yes" ;;
83 *) am_cv_func_working_getline="$gl_cross_guess_normal" ;; 81 *) am_cv_func_working_getline="$gl_cross_guess_normal" ;;
84 esac 82 esac
85 ]) 83 ])
86 ]) 84 ])
87 ]) 85 ])
86 else
87 am_cv_func_working_getline=no
88 case "$gl_cv_onwards_func_getline" in
89 future*) REPLACE_GETLINE=1 ;;
90 esac
88 fi 91 fi
89 92
90 if test $ac_cv_have_decl_getline = no; then 93 if test $ac_cv_have_decl_getline = no; then
diff --git a/gl/m4/getloadavg.m4 b/gl/m4/getloadavg.m4
index 79e420ba..0918bcd2 100644
--- a/gl/m4/getloadavg.m4
+++ b/gl/m4/getloadavg.m4
@@ -1,13 +1,12 @@
1# Check for getloadavg. 1# getloadavg.m4
2 2# serial 13
3# Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2023 Free Software 3dnl Copyright (C) 1992-1996, 1999-2000, 2002-2003, 2006, 2008-2024 Free Software
4# Foundation, Inc. 4dnl Foundation, Inc.
5dnl This file is free software; the Free Software Foundation
6dnl gives unlimited permission to copy and/or distribute it,
7dnl with or without modifications, as long as this notice is preserved.
5 8
6# This file is free software; the Free Software Foundation 9# Check for getloadavg.
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10#serial 10
11 10
12# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent. 11# Autoconf defines AC_FUNC_GETLOADAVG, but that is obsolescent.
13# New applications should use gl_GETLOADAVG instead. 12# New applications should use gl_GETLOADAVG instead.
@@ -20,13 +19,18 @@ AC_DEFUN([gl_GETLOADAVG],
20# Persuade glibc <stdlib.h> to declare getloadavg(). 19# Persuade glibc <stdlib.h> to declare getloadavg().
21AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 20AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
22 21
23gl_save_LIBS=$LIBS 22gl_saved_LIBS=$LIBS
24 23
25# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0, 24# getloadavg is present in libc on glibc >= 2.2, Mac OS X, FreeBSD >= 2.0,
26# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7. 25# NetBSD >= 0.9, OpenBSD >= 2.0, Solaris >= 7.
27HAVE_GETLOADAVG=1 26HAVE_GETLOADAVG=1
28AC_CHECK_FUNC([getloadavg], [], 27gl_CHECK_FUNCS_ANDROID([getloadavg], [[#include <stdlib.h>]])
29 [gl_func_getloadavg_done=no 28if test $ac_cv_func_getloadavg != yes; then
29 case "$gl_cv_onwards_func_getloadavg" in
30 future*) REPLACE_GETLOADAVG=1 ;;
31 esac
32
33 gl_func_getloadavg_done=no
30 34
31 # Some systems with -lutil have (and need) -lkvm as well, some do not. 35 # Some systems with -lutil have (and need) -lkvm as well, some do not.
32 # On Solaris, -lkvm requires nlist from -lelf, so check that first 36 # On Solaris, -lkvm requires nlist from -lelf, so check that first
@@ -73,14 +77,15 @@ AC_CHECK_FUNC([getloadavg], [],
73 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.]) 77 AC_DEFINE([DGUX], [1], [Define to 1 for DGUX with <sys/dg_sys_info.h>.])
74 AC_CHECK_LIB([dgc], [dg_sys_info])]) 78 AC_CHECK_LIB([dgc], [dg_sys_info])])
75 fi 79 fi
76 fi]) 80 fi
81fi
77 82
78if test "x$gl_save_LIBS" = x; then 83if test "x$gl_saved_LIBS" = x; then
79 GETLOADAVG_LIBS=$LIBS 84 GETLOADAVG_LIBS=$LIBS
80else 85else
81 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_save_LIBS!!"` 86 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$gl_saved_LIBS!!"`
82fi 87fi
83LIBS=$gl_save_LIBS 88LIBS=$gl_saved_LIBS
84 89
85AC_SUBST([GETLOADAVG_LIBS])dnl 90AC_SUBST([GETLOADAVG_LIBS])dnl
86 91
diff --git a/gl/m4/getopt.m4 b/gl/m4/getopt.m4
index 7981a095..297722ea 100644
--- a/gl/m4/getopt.m4
+++ b/gl/m4/getopt.m4
@@ -1,5 +1,6 @@
1# getopt.m4 serial 48 1# getopt.m4
2dnl Copyright (C) 2002-2006, 2008-2023 Free Software Foundation, Inc. 2# serial 49
3dnl Copyright (C) 2002-2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -197,8 +198,8 @@ main ()
197 fi 198 fi
198 else 199 else
199 case "$host_os" in 200 case "$host_os" in
200 darwin* | aix* | mingw*) gl_cv_func_getopt_posix="guessing no";; 201 darwin* | aix* | mingw* | windows*) gl_cv_func_getopt_posix="guessing no";;
201 *) gl_cv_func_getopt_posix="guessing yes";; 202 *) gl_cv_func_getopt_posix="guessing yes";;
202 esac 203 esac
203 fi 204 fi
204 ]) 205 ])
diff --git a/gl/m4/getprogname.m4 b/gl/m4/getprogname.m4
index b67c527c..b24f4480 100644
--- a/gl/m4/getprogname.m4
+++ b/gl/m4/getprogname.m4
@@ -1,16 +1,33 @@
1# getprogname.m4 - check for getprogname or replacements for it 1# getprogname.m4
2# serial 8
3dnl Copyright (C) 2016-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
2 7
3# Copyright (C) 2016-2023 Free Software Foundation, Inc. 8# Check for getprogname or replacements for it
4# This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved.
7
8# serial 4
9 9
10AC_DEFUN([gl_FUNC_GETPROGNAME], 10AC_DEFUN([gl_FUNC_GETPROGNAME],
11[ 11[
12 AC_CHECK_FUNCS_ONCE([getprogname getexecname]) 12 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
14 gl_CHECK_FUNCS_ANDROID([getprogname], [[#include <stdlib.h>]])
15 if test $ac_cv_func_getprogname = no; then
16 HAVE_GETPROGNAME=0
17 case "$gl_cv_onwards_func_getprogname" in
18 future*) REPLACE_GETPROGNAME=1 ;;
19 esac
20 fi
21 AC_CHECK_DECLS([program_invocation_name],
22 [],
23 [HAVE_DECL_PROGRAM_INVOCATION_NAME=0],
24 [[#include <errno.h>]])
25])
26
27AC_DEFUN([gl_PREREQ_GETPROGNAME],
28[
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) 29 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
30 AC_CHECK_FUNCS_ONCE([getexecname])
14 ac_found=0 31 ac_found=0
15 AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [], 32 AC_CHECK_DECLS([program_invocation_name], [ac_found=1], [],
16 [#include <errno.h>]) 33 [#include <errno.h>])
diff --git a/gl/m4/gl-openssl.m4 b/gl/m4/gl-openssl.m4
index 7eab4e10..c5e1f7ba 100644
--- a/gl/m4/gl-openssl.m4
+++ b/gl/m4/gl-openssl.m4
@@ -1,5 +1,6 @@
1# gl-openssl.m4 serial 6 1# gl-openssl.m4
2dnl Copyright (C) 2013-2023 Free Software Foundation, Inc. 2# serial 7
3dnl Copyright (C) 2013-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -39,6 +40,9 @@ AC_DEFUN([gl_CRYPTO_CHECK],
39 AC_SUBST([LIB_CRYPTO]) 40 AC_SUBST([LIB_CRYPTO])
40 if test "x$with_openssl" != xno; then 41 if test "x$with_openssl" != xno; then
41 if test "x$with_openssl" = xauto-gpl-compat; then 42 if test "x$with_openssl" = xauto-gpl-compat; then
43 dnl OpenSSL versions < 3 are under the OpenSSL license, which is not
44 dnl GPL compatible.
45 dnl See <https://www.gnu.org/licenses/license-list.en.html#OpenSSL>.
42 AC_CACHE_CHECK([whether openssl is GPL compatible], 46 AC_CACHE_CHECK([whether openssl is GPL compatible],
43 [gl_cv_openssl_gpl_compat], 47 [gl_cv_openssl_gpl_compat],
44 [AC_COMPILE_IFELSE( 48 [AC_COMPILE_IFELSE(
diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4
index 267f0692..fcf84226 100644
--- a/gl/m4/gnulib-cache.m4
+++ b/gl/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
1# Copyright (C) 2002-2023 Free Software Foundation, Inc. 1# Copyright (C) 2002-2024 Free Software Foundation, Inc.
2# 2#
3# This file is free software; you can redistribute it and/or modify 3# This file is free software; you can redistribute it and/or modify
4# it under the terms of the GNU General Public License as published by 4# it under the terms of the GNU General Public License as published by
diff --git a/gl/m4/gnulib-common.m4 b/gl/m4/gnulib-common.m4
index facc3404..cb730449 100644
--- a/gl/m4/gnulib-common.m4
+++ b/gl/m4/gnulib-common.m4
@@ -1,5 +1,6 @@
1# gnulib-common.m4 serial 75a 1# gnulib-common.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 93
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -15,6 +16,10 @@ AC_DEFUN([gl_COMMON], [
15 AC_REQUIRE([gl_ZZGNULIB]) 16 AC_REQUIRE([gl_ZZGNULIB])
16]) 17])
17AC_DEFUN([gl_COMMON_BODY], [ 18AC_DEFUN([gl_COMMON_BODY], [
19 AH_VERBATIM([0witness],
20[/* Witness that <config.h> has been included. */
21#define _GL_CONFIG_H_INCLUDED 1
22])
18 AH_VERBATIM([_GL_GNUC_PREREQ], 23 AH_VERBATIM([_GL_GNUC_PREREQ],
19[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */ 24[/* True if the compiler says it groks GNU C version MAJOR.MINOR. */
20#if defined __GNUC__ && defined __GNUC_MINOR__ 25#if defined __GNUC__ && defined __GNUC_MINOR__
@@ -72,50 +77,74 @@ AC_DEFUN([gl_COMMON_BODY], [
72#endif]) 77#endif])
73 AH_VERBATIM([attribute], 78 AH_VERBATIM([attribute],
74[/* Attributes. */ 79[/* Attributes. */
75#if (defined __has_attribute \ 80/* Define _GL_HAS_ATTRIBUTE only once, because on FreeBSD, with gcc < 5, if
76 && (!defined __clang_minor__ \ 81 <config.h> gets included once again after <sys/cdefs.h>, __has_attribute(x)
77 || (defined __apple_build_version__ \ 82 expands to 0 always, and redefining _GL_HAS_ATTRIBUTE would turn off all
78 ? 6000000 <= __apple_build_version__ \ 83 attributes. */
79 : 3 < __clang_major__ + (5 <= __clang_minor__)))) 84#ifndef _GL_HAS_ATTRIBUTE
80# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__) 85# if (defined __has_attribute \
81#else 86 && (!defined __clang_minor__ \
82# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr 87 || (defined __apple_build_version__ \
83# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3) 88 ? 7000000 <= __apple_build_version__ \
84# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2) 89 : 5 <= __clang_major__)))
85# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3) 90# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
86# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
87# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
88# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
89# define _GL_ATTR_diagnose_if 0
90# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
91# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
92# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
93# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
94# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
95# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
96# ifdef _ICC
97# define _GL_ATTR_may_alias 0
98# else 91# else
99# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3) 92# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
93# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
94# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
95# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
96# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
97# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
98# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
99# define _GL_ATTR_diagnose_if 0
100# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
101# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
102# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
103# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
104# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
105# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
106# ifdef _ICC
107# define _GL_ATTR_may_alias 0
108# else
109# define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
110# endif
111# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
112# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
113# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
114# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
115# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
116# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
117# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
118# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
119# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
120# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
100# endif 121# endif
101# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
102# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
103# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
104# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
105# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
106# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
107# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
108# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
109# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
110# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
111#endif 122#endif
112 123
113/* Disable GCC -Wpedantic if using __has_c_attribute and this is not C23+. */ 124/* Use __has_c_attribute if available. However, do not use with
114#if (defined __has_c_attribute && _GL_GNUC_PREREQ (4, 6) \ 125 pre-C23 GCC, which can issue false positives if -Wpedantic. */
115 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710) 126#if (defined __has_c_attribute \
116# pragma GCC diagnostic ignored "-Wpedantic" 127 && ! (_GL_GNUC_PREREQ (4, 6) \
128 && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) <= 201710))
129# define _GL_HAVE___HAS_C_ATTRIBUTE 1
130#else
131# define _GL_HAVE___HAS_C_ATTRIBUTE 0
117#endif 132#endif
118 133
134/* Define if, in a function declaration, the attributes in bracket syntax
135 [[...]] must come before the attributes in __attribute__((...)) syntax.
136 If this is defined, it is best to avoid the bracket syntax, so that the
137 various _GL_ATTRIBUTE_* can be cumulated on the same declaration in any
138 order. */
139#ifdef __cplusplus
140# if defined __clang__
141# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
142# endif
143#else
144# if defined __GNUC__ && !defined __clang__
145# define _GL_BRACKET_BEFORE_ATTRIBUTE 1
146# endif
147#endif
119]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead. 148]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's alignas instead.
120[ 149[
121/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function 150/* _GL_ATTRIBUTE_ALLOC_SIZE ((N)) declares that the Nth argument of the function
@@ -223,9 +252,11 @@ AC_DEFUN([gl_COMMON_BODY], [
223 - typedef, 252 - typedef,
224 in C++ also: namespace, class, template specialization. */ 253 in C++ also: namespace, class, template specialization. */
225#ifndef _GL_ATTRIBUTE_DEPRECATED 254#ifndef _GL_ATTRIBUTE_DEPRECATED
226# ifdef __has_c_attribute 255# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
227# if __has_c_attribute (__deprecated__) 256# if _GL_HAVE___HAS_C_ATTRIBUTE
228# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]] 257# if __has_c_attribute (__deprecated__)
258# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
259# endif
229# endif 260# endif
230# endif 261# endif
231# if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated) 262# if !defined _GL_ATTRIBUTE_DEPRECATED && _GL_HAS_ATTRIBUTE (deprecated)
@@ -271,7 +302,7 @@ AC_DEFUN([gl_COMMON_BODY], [
271/* Applies to: Empty statement (;), inside a 'switch' statement. */ 302/* Applies to: Empty statement (;), inside a 'switch' statement. */
272/* Always expands to something. */ 303/* Always expands to something. */
273#ifndef _GL_ATTRIBUTE_FALLTHROUGH 304#ifndef _GL_ATTRIBUTE_FALLTHROUGH
274# ifdef __has_c_attribute 305# if _GL_HAVE___HAS_C_ATTRIBUTE
275# if __has_c_attribute (__fallthrough__) 306# if __has_c_attribute (__fallthrough__)
276# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]] 307# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
277# endif 308# endif
@@ -351,11 +382,19 @@ AC_DEFUN([gl_COMMON_BODY], [
351 in C++ also: class. */ 382 in C++ also: class. */
352/* In C++ and C23, this is spelled [[__maybe_unused__]]. 383/* In C++ and C23, this is spelled [[__maybe_unused__]].
353 GCC's syntax is __attribute__ ((__unused__)). 384 GCC's syntax is __attribute__ ((__unused__)).
354 clang supports both syntaxes. */ 385 clang supports both syntaxes. Except that with clang ≥ 6, < 10, in C++ mode,
386 __has_c_attribute (__maybe_unused__) yields true but the use of
387 [[__maybe_unused__]] nevertheless produces a warning. */
355#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED 388#ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
356# ifdef __has_c_attribute 389# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
357# if __has_c_attribute (__maybe_unused__) 390# if defined __clang__ && defined __cplusplus
358# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]] 391# if !defined __apple_build_version__ && __clang_major__ >= 10
392# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
393# endif
394# elif _GL_HAVE___HAS_C_ATTRIBUTE
395# if __has_c_attribute (__maybe_unused__)
396# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
397# endif
359# endif 398# endif
360# endif 399# endif
361# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED 400# ifndef _GL_ATTRIBUTE_MAYBE_UNUSED
@@ -373,9 +412,20 @@ AC_DEFUN([gl_COMMON_BODY], [
373 the return value, unless the caller uses something like ignore_value. */ 412 the return value, unless the caller uses something like ignore_value. */
374/* Applies to: function, enumeration, class. */ 413/* Applies to: function, enumeration, class. */
375#ifndef _GL_ATTRIBUTE_NODISCARD 414#ifndef _GL_ATTRIBUTE_NODISCARD
376# ifdef __has_c_attribute 415# ifndef _GL_BRACKET_BEFORE_ATTRIBUTE
377# if __has_c_attribute (__nodiscard__) 416# if defined __clang__ && defined __cplusplus
378# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]] 417 /* With clang up to 15.0.6 (at least), in C++ mode, [[__nodiscard__]] produces
418 a warning.
419 The 1000 below means a yet unknown threshold. When clang++ version X
420 starts supporting [[__nodiscard__]] without warning about it, you can
421 replace the 1000 with X. */
422# if __clang_major__ >= 1000
423# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
424# endif
425# elif _GL_HAVE___HAS_C_ATTRIBUTE
426# if __has_c_attribute (__nodiscard__)
427# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
428# endif
379# endif 429# endif
380# endif 430# endif
381# if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result) 431# if !defined _GL_ATTRIBUTE_NODISCARD && _GL_HAS_ATTRIBUTE (warn_unused_result)
@@ -427,11 +477,25 @@ AC_DEFUN([gl_COMMON_BODY], [
427/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions. 477/* _GL_ATTRIBUTE_NOTHROW declares that the function does not throw exceptions.
428 */ 478 */
429/* Applies to: functions. */ 479/* Applies to: functions. */
480/* After a function's parameter list, this attribute must come first, before
481 other attributes. */
430#ifndef _GL_ATTRIBUTE_NOTHROW 482#ifndef _GL_ATTRIBUTE_NOTHROW
431# if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus 483# if defined __cplusplus
432# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__)) 484# if _GL_GNUC_PREREQ (2, 8) || __clang_major >= 4
485# if __cplusplus >= 201103L
486# define _GL_ATTRIBUTE_NOTHROW noexcept (true)
487# else
488# define _GL_ATTRIBUTE_NOTHROW throw ()
489# endif
490# else
491# define _GL_ATTRIBUTE_NOTHROW
492# endif
433# else 493# else
434# define _GL_ATTRIBUTE_NOTHROW 494# if _GL_HAS_ATTRIBUTE (nothrow)
495# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
496# else
497# define _GL_ATTRIBUTE_NOTHROW
498# endif
435# endif 499# endif
436#endif 500#endif
437 501
@@ -441,8 +505,10 @@ AC_DEFUN([gl_COMMON_BODY], [
441 minimizing the memory required. */ 505 minimizing the memory required. */
442/* Applies to: struct members, struct, union, 506/* Applies to: struct members, struct, union,
443 in C++ also: class. */ 507 in C++ also: class. */
508/* Oracle Studio 12.6 miscompiles code with __attribute__ ((__packed__)) despite
509 __has_attribute OK. */
444#ifndef _GL_ATTRIBUTE_PACKED 510#ifndef _GL_ATTRIBUTE_PACKED
445# if _GL_HAS_ATTRIBUTE (packed) 511# if _GL_HAS_ATTRIBUTE (packed) && !defined __SUNPRO_C
446# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__)) 512# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
447# else 513# else
448# define _GL_ATTRIBUTE_PACKED 514# define _GL_ATTRIBUTE_PACKED
@@ -513,6 +579,18 @@ AC_DEFUN([gl_COMMON_BODY], [
513# endif 579# endif
514#endif 580#endif
515]) 581])
582 AH_VERBATIM([c_linkage],
583[/* In C++, there is the concept of "language linkage", that encompasses
584 name mangling and function calling conventions.
585 The following macros start and end a block of "C" linkage. */
586#ifdef __cplusplus
587# define _GL_BEGIN_C_LINKAGE extern "C" {
588# define _GL_END_C_LINKAGE }
589#else
590# define _GL_BEGIN_C_LINKAGE
591# define _GL_END_C_LINKAGE
592#endif
593])
516 AH_VERBATIM([async_safe], 594 AH_VERBATIM([async_safe],
517[/* The _GL_ASYNC_SAFE marker should be attached to functions that are 595[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
518 signal handlers (for signals other than SIGABRT, SIGPIPE) or can be 596 signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
@@ -568,7 +646,7 @@ AC_DEFUN([gl_COMMON_BODY], [
568 dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad), 646 dnl gl_cross_guess_normal (to be used when 'yes' is good and 'no' is bad),
569 dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad). 647 dnl gl_cross_guess_inverted (to be used when 'no' is good and 'yes' is bad).
570 AC_ARG_ENABLE([cross-guesses], 648 AC_ARG_ENABLE([cross-guesses],
571 [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}], 649 [AS_HELP_STRING([[--enable-cross-guesses={conservative|risky}]],
572 [specify policy for cross-compilation guesses])], 650 [specify policy for cross-compilation guesses])],
573 [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then 651 [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
574 AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses]) 652 AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
@@ -1005,6 +1083,7 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
1005 dnl -Wno-pedantic >= 4.8 >= 3.9 1083 dnl -Wno-pedantic >= 4.8 >= 3.9
1006 dnl -Wno-sign-compare >= 3 >= 3.9 1084 dnl -Wno-sign-compare >= 3 >= 3.9
1007 dnl -Wno-sign-conversion >= 4.3 >= 3.9 1085 dnl -Wno-sign-conversion >= 4.3 >= 3.9
1086 dnl -Wno-tautological-out-of-range-compare - >= 3.9
1008 dnl -Wno-type-limits >= 4.3 >= 3.9 1087 dnl -Wno-type-limits >= 4.3 >= 3.9
1009 dnl -Wno-undef >= 3 >= 3.9 1088 dnl -Wno-undef >= 3 >= 3.9
1010 dnl -Wno-unsuffixed-float-constants >= 4.5 1089 dnl -Wno-unsuffixed-float-constants >= 4.5
@@ -1030,6 +1109,9 @@ AC_DEFUN([gl_CC_GNULIB_WARNINGS],
1030 #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) 1109 #if __GNUC__ + (__GNUC_MINOR__ >= 8) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
1031 -Wno-pedantic 1110 -Wno-pedantic
1032 #endif 1111 #endif
1112 #if 3 < __clang_major__ + (9 <= __clang_minor__)
1113 -Wno-tautological-constant-out-of-range-compare
1114 #endif
1033 #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3) 1115 #if __GNUC__ + (__GNUC_MINOR__ >= 3) > 4 || (__clang_major__ + (__clang_minor__ >= 9) > 3)
1034 -Wno-sign-conversion 1116 -Wno-sign-conversion
1035 -Wno-type-limits 1117 -Wno-type-limits
@@ -1080,6 +1162,238 @@ AC_DEFUN([gl_CONDITIONAL_HEADER],
1080 m4_popdef([gl_header_name]) 1162 m4_popdef([gl_header_name])
1081]) 1163])
1082 1164
1165dnl Preparations for gl_CHECK_FUNCS_MACOS.
1166AC_DEFUN([gl_PREPARE_CHECK_FUNCS_MACOS],
1167[
1168 AC_REQUIRE([AC_CANONICAL_HOST])
1169 AC_REQUIRE([gl_COMPILER_CLANG])
1170 AC_CACHE_CHECK([for compiler option needed when checking for future declarations],
1171 [gl_cv_compiler_check_future_option],
1172 [case "$host_os" in
1173 dnl This is only needed on macOS.
1174 darwin*)
1175 if test $gl_cv_compiler_clang = yes; then
1176 dnl Test whether the compiler supports the option
1177 dnl '-Werror=unguarded-availability-new'.
1178 saved_ac_compile="$ac_compile"
1179 ac_compile="$ac_compile -Werror=unguarded-availability-new"
1180 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
1181 [gl_cv_compiler_check_future_option='-Werror=unguarded-availability-new'],
1182 [gl_cv_compiler_check_future_option=none])
1183 ac_compile="$saved_ac_compile"
1184 else
1185 gl_cv_compiler_check_future_option=none
1186 fi
1187 ;;
1188 *) gl_cv_compiler_check_future_option=none ;;
1189 esac
1190 ])
1191])
1192
1193dnl Pieces of the expansion of
1194dnl gl_CHECK_FUNCS_ANDROID
1195dnl gl_CHECK_FUNCS_MACOS
1196dnl gl_CHECK_FUNCS_ANDROID_MACOS
1197
1198AC_DEFUN([gl_CHECK_FUNCS_DEFAULT_CASE],
1199[
1200 *)
1201 AC_CHECK_FUNC([$1])
1202 [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1]
1203 ;;
1204])
1205
1206AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_ANDROID],
1207[
1208 linux*-android*)
1209 AC_CHECK_DECL([$1], , , [$2])
1210 if test $[ac_cv_have_decl_][$1] = yes; then
1211 AC_CHECK_FUNC([[$1]])
1212 if test $[ac_cv_func_][$1] = yes; then
1213 [gl_cv_onwards_func_][$1]=yes
1214 else
1215 dnl The function is declared but does not exist. This should not
1216 dnl happen normally. But anyway, we know that a future version
1217 dnl of Android will have the function.
1218 [gl_cv_onwards_func_][$1]='future OS version'
1219 fi
1220 else
1221 [gl_cv_onwards_func_][$1]='future OS version'
1222 fi
1223 ;;
1224])
1225
1226AC_DEFUN([gl_CHECK_FUNCS_CASE_FOR_MACOS],
1227[
1228 darwin*)
1229 if test "x$gl_cv_compiler_check_future_option" != "xnone"; then
1230 dnl Use a compile test, not a link test.
1231 saved_ac_compile="$ac_compile"
1232 ac_compile="$ac_compile $gl_cv_compiler_check_future_option"
1233 saved_ac_compile_for_check_decl="$ac_compile_for_check_decl"
1234 ac_compile_for_check_decl="$ac_compile_for_check_decl $gl_cv_compiler_check_future_option"
1235 unset [ac_cv_have_decl_][$1]
1236 AC_CHECK_DECL([$1], , , [$2])
1237 ac_compile="$saved_ac_compile"
1238 ac_compile_for_check_decl="$saved_ac_compile_for_check_decl"
1239 [ac_cv_func_][$1]="$[ac_cv_have_decl_][$1]"
1240 if test $[ac_cv_func_][$1] = yes; then
1241 [gl_cv_onwards_func_][$1]=yes
1242 else
1243 unset [ac_cv_have_decl_][$1]
1244 AC_CHECK_DECL([$1], , , [$2])
1245 if test $[ac_cv_have_decl_][$1] = yes; then
1246 [gl_cv_onwards_func_][$1]='future OS version'
1247 else
1248 [gl_cv_onwards_func_][$1]=no
1249 fi
1250 fi
1251 else
1252 AC_CHECK_FUNC([$1])
1253 [gl_cv_onwards_func_][$1]=$[ac_cv_func_][$1]
1254 fi
1255 ;;
1256])
1257
1258AC_DEFUN([gl_CHECK_FUNCS_SET_RESULTS],
1259[
1260 case "$[gl_cv_onwards_func_][$1]" in
1261 future*) [ac_cv_func_][$1]=no ;;
1262 *) [ac_cv_func_][$1]=$[gl_cv_onwards_func_][$1] ;;
1263 esac
1264 if test $[ac_cv_func_][$1] = yes; then
1265 AC_DEFINE([HAVE_]m4_translit([[$1]],
1266 [abcdefghijklmnopqrstuvwxyz],
1267 [ABCDEFGHIJKLMNOPQRSTUVWXYZ]),
1268 [1], [Define to 1 if you have the `$1' function.])
1269 fi
1270])
1271
1272dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
1273dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
1274dnl on Android.
1275dnl
1276dnl When code is compiled on Android, it is in the context of a certain
1277dnl "Android API level", which indicates the minimum version of Android on
1278dnl which the app can be installed. In other words, you don't compile for a
1279dnl specific version of Android. You compile for all versions of Android,
1280dnl onwards from the given API level.
1281dnl Thus, the question "does the OS have the function func" has three possible
1282dnl answers:
1283dnl - yes, in all versions starting from the given API level,
1284dnl - no, in no version,
1285dnl - not in the given API level, but in a later version of Android.
1286dnl
1287dnl In detail, this works as follows:
1288dnl If func was added to Android API level, say, 28, then the libc.so has the
1289dnl symbol func always, whereas the header file <foo.h> declares func
1290dnl conditionally:
1291dnl #if __ANDROID_API__ >= 28
1292dnl ... func (...) __INTRODUCED_IN(28);
1293dnl #endif
1294dnl Thus, when compiling with "clang -target armv7a-unknown-linux-android28",
1295dnl the function func is declared and exists in libc.
1296dnl Whereas when compiling with "clang -target armv7a-unknown-linux-android27",
1297dnl the function func is not declared but exists in libc.
1298dnl
1299dnl This macro sets two variables:
1300dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
1301dnl - ac_cv_func_<func> to yes / no / no
1302dnl The first variable allows to distinguish all three cases.
1303dnl The second variable is set, so that an invocation
1304dnl gl_CHECK_FUNCS_ANDROID([func], [[#include <foo.h>]])
1305dnl can be used as a drop-in replacement for
1306dnl AC_CHECK_FUNCS([func]).
1307AC_DEFUN([gl_CHECK_FUNCS_ANDROID],
1308[
1309 AC_REQUIRE([AC_CANONICAL_HOST])
1310 AC_CACHE_CHECK([for [$1]],
1311 [[gl_cv_onwards_func_][$1]],
1312 [gl_SILENT([
1313 case "$host_os" in
1314 gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2])
1315 gl_CHECK_FUNCS_DEFAULT_CASE([$1])
1316 esac
1317 ])
1318 ])
1319 gl_CHECK_FUNCS_SET_RESULTS([$1])
1320])
1321
1322dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]])
1323dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
1324dnl on macOS.
1325dnl
1326dnl When code is compiled on macOS, it is in the context of a certain minimum
1327dnl macOS version, that can be set through the option '-mmacosx-version-min='.
1328dnl In other words, you don't compile for a specific version of macOS. You
1329dnl compile for all versions of macOS, onwards from the given version.
1330dnl Thus, the question "does the OS have the function func" has three possible
1331dnl answers:
1332dnl - yes, in all versions starting from the given version,
1333dnl - no, in no version,
1334dnl - not in the given version, but in a later version of macOS.
1335dnl
1336dnl In detail, this works as follows:
1337dnl If func was added to, say, macOS version 13, then the libc has the
1338dnl symbol func always, whereas the header file <foo.h> declares func
1339dnl conditionally with a special availability attribute:
1340dnl ... func (...) __attribute__((availability(macos,introduced=13.0)));
1341dnl Thus, when compiling with "clang mmacosx-version-min=13", there is no
1342dnl warning about the use of func, and the resulting binary
1343dnl - runs fine on macOS 13,
1344dnl - aborts with a dyld "Symbol not found" message on macOS 12.
1345dnl Whereas, when compiling with "clang mmacosx-version-min=12", there is a
1346dnl warning: 'func' is only available on macOS 13.0 or newer
1347dnl [-Wunguarded-availability-new],
1348dnl and the resulting binary
1349dnl - runs fine on macOS 13,
1350dnl - crashes with a SIGSEGV (signal 11) on macOS 12.
1351dnl
1352dnl This macro sets two variables:
1353dnl - gl_cv_onwards_func_<func> to yes / no / "future OS version"
1354dnl - ac_cv_func_<func> to yes / no / no
1355dnl The first variable allows to distinguish all three cases.
1356dnl The second variable is set, so that an invocation
1357dnl gl_CHECK_FUNCS_MACOS([func], [[#include <foo.h>]])
1358dnl can be used as a drop-in replacement for
1359dnl AC_CHECK_FUNCS([func]).
1360AC_DEFUN([gl_CHECK_FUNCS_MACOS],
1361[
1362 AC_REQUIRE([AC_CANONICAL_HOST])
1363 AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS])
1364 AC_CACHE_CHECK([for [$1]],
1365 [[gl_cv_onwards_func_][$1]],
1366 [gl_SILENT([
1367 case "$host_os" in
1368 gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2])
1369 gl_CHECK_FUNCS_DEFAULT_CASE([$1])
1370 esac
1371 ])
1372 ])
1373 gl_CHECK_FUNCS_SET_RESULTS([$1])
1374])
1375
1376dnl gl_CHECK_FUNCS_ANDROID_MACOS([func], [[#include <foo.h>]])
1377dnl is like AC_CHECK_FUNCS([func]), taking into account a portability problem
1378dnl on Android and on macOS.
1379dnl It is the combination of gl_CHECK_FUNCS_ANDROID and gl_CHECK_FUNCS_MACOS.
1380AC_DEFUN([gl_CHECK_FUNCS_ANDROID_MACOS],
1381[
1382 AC_REQUIRE([AC_CANONICAL_HOST])
1383 AC_REQUIRE([gl_PREPARE_CHECK_FUNCS_MACOS])
1384 AC_CACHE_CHECK([for [$1]],
1385 [[gl_cv_onwards_func_][$1]],
1386 [gl_SILENT([
1387 case "$host_os" in
1388 gl_CHECK_FUNCS_CASE_FOR_ANDROID([$1], [$2])
1389 gl_CHECK_FUNCS_CASE_FOR_MACOS([$1], [$2])
1390 gl_CHECK_FUNCS_DEFAULT_CASE([$1])
1391 esac
1392 ])
1393 ])
1394 gl_CHECK_FUNCS_SET_RESULTS([$1])
1395])
1396
1083dnl Expands to some code for use in .c programs that, on native Windows, defines 1397dnl Expands to some code for use in .c programs that, on native Windows, defines
1084dnl the Microsoft deprecated alias function names to the underscore-prefixed 1398dnl the Microsoft deprecated alias function names to the underscore-prefixed
1085dnl actual function names. With this macro, these function names are available 1399dnl actual function names. With this macro, these function names are available
diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4
index 4764622e..83a0f727 100644
--- a/gl/m4/gnulib-comp.m4
+++ b/gl/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
1# DO NOT EDIT! GENERATED AUTOMATICALLY! 1# DO NOT EDIT! GENERATED AUTOMATICALLY!
2# Copyright (C) 2002-2023 Free Software Foundation, Inc. 2# Copyright (C) 2002-2024 Free Software Foundation, Inc.
3# 3#
4# This file is free software; you can redistribute it and/or modify 4# This file is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by 5# it under the terms of the GNU General Public License as published by
@@ -43,6 +43,7 @@ AC_DEFUN([gl_EARLY],
43 AC_REQUIRE([gl_PROG_AR_RANLIB]) 43 AC_REQUIRE([gl_PROG_AR_RANLIB])
44 44
45 # Code from module absolute-header: 45 # Code from module absolute-header:
46 # Code from module alignasof:
46 # Code from module alloca-opt: 47 # Code from module alloca-opt:
47 # Code from module arpa_inet: 48 # Code from module arpa_inet:
48 # Code from module assert-h: 49 # Code from module assert-h:
@@ -67,6 +68,7 @@ AC_DEFUN([gl_EARLY],
67 # Code from module environ: 68 # Code from module environ:
68 # Code from module errno: 69 # Code from module errno:
69 # Code from module error: 70 # Code from module error:
71 # Code from module error-h:
70 # Code from module exitfail: 72 # Code from module exitfail:
71 # Code from module extensions: 73 # Code from module extensions:
72 # Code from module extern-inline: 74 # Code from module extern-inline:
@@ -112,6 +114,11 @@ AC_DEFUN([gl_EARLY],
112 # Code from module inet_ntop: 114 # Code from module inet_ntop:
113 # Code from module intprops: 115 # Code from module intprops:
114 # Code from module inttypes-incomplete: 116 # Code from module inttypes-incomplete:
117 # Code from module iswblank:
118 # Code from module iswctype:
119 # Code from module iswdigit:
120 # Code from module iswpunct:
121 # Code from module iswxdigit:
115 # Code from module langinfo: 122 # Code from module langinfo:
116 # Code from module largefile: 123 # Code from module largefile:
117 AC_REQUIRE([AC_SYS_LARGEFILE]) 124 AC_REQUIRE([AC_SYS_LARGEFILE])
@@ -128,6 +135,7 @@ AC_DEFUN([gl_EARLY],
128 # Code from module math: 135 # Code from module math:
129 # Code from module mbrtowc: 136 # Code from module mbrtowc:
130 # Code from module mbsinit: 137 # Code from module mbsinit:
138 # Code from module mbszero:
131 # Code from module mbtowc: 139 # Code from module mbtowc:
132 # Code from module memchr: 140 # Code from module memchr:
133 # Code from module minmax: 141 # Code from module minmax:
@@ -150,6 +158,7 @@ AC_DEFUN([gl_EARLY],
150 # Code from module servent: 158 # Code from module servent:
151 # Code from module setenv: 159 # Code from module setenv:
152 # Code from module setlocale-null: 160 # Code from module setlocale-null:
161 # Code from module setlocale-null-unlocked:
153 # Code from module size_max: 162 # Code from module size_max:
154 # Code from module snippet/_Noreturn: 163 # Code from module snippet/_Noreturn:
155 # Code from module snippet/arg-nonnull: 164 # Code from module snippet/arg-nonnull:
@@ -163,12 +172,12 @@ AC_DEFUN([gl_EARLY],
163 # Code from module stat: 172 # Code from module stat:
164 # Code from module stat-time: 173 # Code from module stat-time:
165 # Code from module std-gnu11: 174 # Code from module std-gnu11:
166 # Code from module stdalign:
167 # Code from module stdbool: 175 # Code from module stdbool:
168 # Code from module stdckdint: 176 # Code from module stdckdint:
169 # Code from module stddef: 177 # Code from module stddef:
170 # Code from module stdint: 178 # Code from module stdint:
171 # Code from module stdio: 179 # Code from module stdio:
180 gl_STDIO_H_EARLY
172 # Code from module stdlib: 181 # Code from module stdlib:
173 # Code from module strcase: 182 # Code from module strcase:
174 # Code from module strcasestr: 183 # Code from module strcasestr:
@@ -186,7 +195,7 @@ AC_DEFUN([gl_EARLY],
186 # Code from module sys_uio: 195 # Code from module sys_uio:
187 # Code from module threadlib: 196 # Code from module threadlib:
188 gl_THREADLIB_EARLY 197 gl_THREADLIB_EARLY
189 # Code from module time: 198 # Code from module time-h:
190 # Code from module time_r: 199 # Code from module time_r:
191 # Code from module timegm: 200 # Code from module timegm:
192 # Code from module unistd: 201 # Code from module unistd:
@@ -199,6 +208,7 @@ AC_DEFUN([gl_EARLY],
199 # Code from module vsnprintf: 208 # Code from module vsnprintf:
200 # Code from module wchar: 209 # Code from module wchar:
201 # Code from module wcrtomb: 210 # Code from module wcrtomb:
211 # Code from module wctype:
202 # Code from module wctype-h: 212 # Code from module wctype-h:
203 # Code from module windows-mutex: 213 # Code from module windows-mutex:
204 # Code from module windows-once: 214 # Code from module windows-once:
@@ -229,6 +239,7 @@ AC_DEFUN([gl_INIT],
229 gl_COMMON 239 gl_COMMON
230 gl_source_base='gl' 240 gl_source_base='gl'
231 gl_source_base_prefix= 241 gl_source_base_prefix=
242 gl_ALIGNASOF
232 gl_FUNC_ALLOCA 243 gl_FUNC_ALLOCA
233 gl_CONDITIONAL_HEADER([alloca.h]) 244 gl_CONDITIONAL_HEADER([alloca.h])
234 AC_PROG_MKDIR_P 245 AC_PROG_MKDIR_P
@@ -280,14 +291,17 @@ AC_DEFUN([gl_INIT],
280 gl_HEADER_ERRNO_H 291 gl_HEADER_ERRNO_H
281 gl_CONDITIONAL_HEADER([errno.h]) 292 gl_CONDITIONAL_HEADER([errno.h])
282 AC_PROG_MKDIR_P 293 AC_PROG_MKDIR_P
294 AC_REQUIRE([gl_ERROR_H])
283 gl_ERROR 295 gl_ERROR
284 gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test "$ac_cv_lib_error_at_line" = no]) 296 gl_CONDITIONAL([GL_COND_OBJ_ERROR], [test $COMPILE_ERROR_C = 1])
285 AM_COND_IF([GL_COND_OBJ_ERROR], [ 297 AM_COND_IF([GL_COND_OBJ_ERROR], [
286 gl_PREREQ_ERROR 298 gl_PREREQ_ERROR
287 ]) 299 ])
288 m4_ifdef([AM_XGETTEXT_OPTION], 300 m4_ifdef([AM_XGETTEXT_OPTION],
289 [AM_][XGETTEXT_OPTION([--flag=error:3:c-format]) 301 [AM_][XGETTEXT_OPTION([--flag=error:3:c-format])
290 AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])]) 302 AM_][XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
303 gl_ERROR_H
304 AC_PROG_MKDIR_P
291 AC_REQUIRE([gl_EXTERN_INLINE]) 305 AC_REQUIRE([gl_EXTERN_INLINE])
292 gl_FUNC_FCNTL 306 gl_FUNC_FCNTL
293 gl_CONDITIONAL([GL_COND_OBJ_FCNTL], 307 gl_CONDITIONAL([GL_COND_OBJ_FCNTL],
@@ -350,7 +364,7 @@ AC_DEFUN([gl_INIT],
350 gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1]) 364 gl_CONDITIONAL([GL_COND_OBJ_FSTAT], [test $REPLACE_FSTAT = 1])
351 AM_COND_IF([GL_COND_OBJ_FSTAT], [ 365 AM_COND_IF([GL_COND_OBJ_FSTAT], [
352 case "$host_os" in 366 case "$host_os" in
353 mingw*) 367 mingw* | windows*)
354 AC_LIBOBJ([stat-w32]) 368 AC_LIBOBJ([stat-w32])
355 ;; 369 ;;
356 esac 370 esac
@@ -406,7 +420,8 @@ AC_DEFUN([gl_INIT],
406 gl_STDIO_MODULE_INDICATOR([getline]) 420 gl_STDIO_MODULE_INDICATOR([getline])
407 AC_REQUIRE([AC_CANONICAL_HOST]) 421 AC_REQUIRE([AC_CANONICAL_HOST])
408 gl_GETLOADAVG 422 gl_GETLOADAVG
409 gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG], [test $HAVE_GETLOADAVG = 0]) 423 gl_CONDITIONAL([GL_COND_OBJ_GETLOADAVG],
424 [test $HAVE_GETLOADAVG = 0 || test $REPLACE_GETLOADAVG = 1])
410 AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [ 425 AM_COND_IF([GL_COND_OBJ_GETLOADAVG], [
411 gl_PREREQ_GETLOADAVG 426 gl_PREREQ_GETLOADAVG
412 ]) 427 ])
@@ -427,11 +442,20 @@ AC_DEFUN([gl_INIT],
427 ]) 442 ])
428 gl_UNISTD_MODULE_INDICATOR([getopt-posix]) 443 gl_UNISTD_MODULE_INDICATOR([getopt-posix])
429 gl_FUNC_GETPROGNAME 444 gl_FUNC_GETPROGNAME
445 gl_CONDITIONAL([GL_COND_OBJ_GETPROGNAME],
446 [test $HAVE_GETPROGNAME = 0 || test $REPLACE_GETPROGNAME = 1])
447 AM_COND_IF([GL_COND_OBJ_GETPROGNAME], [
448 gl_PREREQ_GETPROGNAME
449 ])
450 gl_STDLIB_MODULE_INDICATOR([getprogname])
430 AC_SUBST([LIBINTL]) 451 AC_SUBST([LIBINTL])
431 AC_SUBST([LTLIBINTL]) 452 AC_SUBST([LTLIBINTL])
432 AC_PROG_MKDIR_P 453 AC_PROG_MKDIR_P
433 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) 454 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
434 LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL" 455 HARD_LOCALE_LIB="$SETLOCALE_NULL_LIB"
456 AC_SUBST([HARD_LOCALE_LIB])
457 dnl For backward compatibility.
458 LIB_HARD_LOCALE="$HARD_LOCALE_LIB"
435 AC_SUBST([LIB_HARD_LOCALE]) 459 AC_SUBST([LIB_HARD_LOCALE])
436 gl_HOSTENT 460 gl_HOSTENT
437 gl_IDPRIV 461 gl_IDPRIV
@@ -445,6 +469,26 @@ AC_DEFUN([gl_INIT],
445 gl_INTTYPES_INCOMPLETE 469 gl_INTTYPES_INCOMPLETE
446 gl_INTTYPES_H_REQUIRE_DEFAULTS 470 gl_INTTYPES_H_REQUIRE_DEFAULTS
447 AC_PROG_MKDIR_P 471 AC_PROG_MKDIR_P
472 gl_FUNC_ISWBLANK
473 gl_CONDITIONAL([GL_COND_OBJ_ISWBLANK],
474 [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && { test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; }])
475 gl_WCTYPE_MODULE_INDICATOR([iswblank])
476 gl_FUNC_ISWCTYPE
477 gl_CONDITIONAL([GL_COND_OBJ_ISWCTYPE],
478 [test $HAVE_WCTYPE_T = 0 || test $GNULIBHEADERS_OVERRIDE_WINT_T = 1 || test $REPLACE_WCTYPE = 1])
479 gl_WCTYPE_MODULE_INDICATOR([iswctype])
480 gl_FUNC_ISWDIGIT
481 gl_CONDITIONAL([GL_COND_OBJ_ISWDIGIT],
482 [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWDIGIT = 1])
483 gl_WCTYPE_MODULE_INDICATOR([iswdigit])
484 gl_FUNC_ISWPUNCT
485 gl_CONDITIONAL([GL_COND_OBJ_ISWPUNCT],
486 [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWPUNCT = 1])
487 gl_WCTYPE_MODULE_INDICATOR([iswpunct])
488 gl_FUNC_ISWXDIGIT
489 gl_CONDITIONAL([GL_COND_OBJ_ISWXDIGIT],
490 [! { test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; } && test $REPLACE_ISWXDIGIT = 1])
491 gl_WCTYPE_MODULE_INDICATOR([iswxdigit])
448 gl_LANGINFO_H 492 gl_LANGINFO_H
449 gl_LANGINFO_H_REQUIRE_DEFAULTS 493 gl_LANGINFO_H_REQUIRE_DEFAULTS
450 AC_PROG_MKDIR_P 494 AC_PROG_MKDIR_P
@@ -504,6 +548,10 @@ AC_DEFUN([gl_INIT],
504 gl_PREREQ_MBSINIT 548 gl_PREREQ_MBSINIT
505 ]) 549 ])
506 gl_WCHAR_MODULE_INDICATOR([mbsinit]) 550 gl_WCHAR_MODULE_INDICATOR([mbsinit])
551 AC_REQUIRE([AC_TYPE_MBSTATE_T])
552 gl_MBSTATE_T_BROKEN
553 gl_MUSL_LIBC
554 gl_WCHAR_MODULE_INDICATOR([mbszero])
507 gl_FUNC_MBTOWC 555 gl_FUNC_MBTOWC
508 gl_CONDITIONAL([GL_COND_OBJ_MBTOWC], 556 gl_CONDITIONAL([GL_COND_OBJ_MBTOWC],
509 [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1]) 557 [test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1])
@@ -611,7 +659,7 @@ AC_DEFUN([gl_INIT],
611 gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1]) 659 gl_CONDITIONAL([GL_COND_OBJ_STAT], [test $REPLACE_STAT = 1])
612 AM_COND_IF([GL_COND_OBJ_STAT], [ 660 AM_COND_IF([GL_COND_OBJ_STAT], [
613 case "$host_os" in 661 case "$host_os" in
614 mingw*) 662 mingw* | windows*)
615 AC_LIBOBJ([stat-w32]) 663 AC_LIBOBJ([stat-w32])
616 ;; 664 ;;
617 esac 665 esac
@@ -620,9 +668,6 @@ AC_DEFUN([gl_INIT],
620 gl_SYS_STAT_MODULE_INDICATOR([stat]) 668 gl_SYS_STAT_MODULE_INDICATOR([stat])
621 gl_STAT_TIME 669 gl_STAT_TIME
622 gl_STAT_BIRTHTIME 670 gl_STAT_BIRTHTIME
623 gl_STDALIGN_H
624 gl_CONDITIONAL_HEADER([stdalign.h])
625 AC_PROG_MKDIR_P
626 gl_C_BOOL 671 gl_C_BOOL
627 AC_CHECK_HEADERS_ONCE([stdckdint.h]) 672 AC_CHECK_HEADERS_ONCE([stdckdint.h])
628 if test $ac_cv_header_stdckdint_h = yes; then 673 if test $ac_cv_header_stdckdint_h = yes; then
@@ -781,21 +826,24 @@ AC_DEFUN([gl_INIT],
781 gl_PREREQ_WCRTOMB 826 gl_PREREQ_WCRTOMB
782 ]) 827 ])
783 gl_WCHAR_MODULE_INDICATOR([wcrtomb]) 828 gl_WCHAR_MODULE_INDICATOR([wcrtomb])
829 gl_FUNC_WCTYPE
830 gl_CONDITIONAL([GL_COND_OBJ_WCTYPE], [test $HAVE_WCTYPE = 0 || test $REPLACE_WCTYPE = 1])
831 gl_WCTYPE_MODULE_INDICATOR([wctype])
784 gl_WCTYPE_H 832 gl_WCTYPE_H
785 gl_WCTYPE_H_REQUIRE_DEFAULTS 833 gl_WCTYPE_H_REQUIRE_DEFAULTS
786 AC_PROG_MKDIR_P 834 AC_PROG_MKDIR_P
787 AC_REQUIRE([AC_CANONICAL_HOST]) 835 AC_REQUIRE([AC_CANONICAL_HOST])
788 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX], 836 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_MUTEX],
789 [case "$host_os" in mingw*) true;; *) false;; esac]) 837 [case "$host_os" in mingw* | windows*) true;; *) false;; esac])
790 AC_REQUIRE([AC_CANONICAL_HOST]) 838 AC_REQUIRE([AC_CANONICAL_HOST])
791 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE], 839 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_ONCE],
792 [case "$host_os" in mingw*) true;; *) false;; esac]) 840 [case "$host_os" in mingw* | windows*) true;; *) false;; esac])
793 AC_REQUIRE([AC_CANONICAL_HOST]) 841 AC_REQUIRE([AC_CANONICAL_HOST])
794 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX], 842 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RECMUTEX],
795 [case "$host_os" in mingw*) true;; *) false;; esac]) 843 [case "$host_os" in mingw* | windows*) true;; *) false;; esac])
796 AC_REQUIRE([AC_CANONICAL_HOST]) 844 AC_REQUIRE([AC_CANONICAL_HOST])
797 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK], 845 gl_CONDITIONAL([GL_COND_OBJ_WINDOWS_RWLOCK],
798 [case "$host_os" in mingw*) true;; *) false;; esac]) 846 [case "$host_os" in mingw* | windows*) true;; *) false;; esac])
799 gl_XALLOC 847 gl_XALLOC
800 gl_MODULE_INDICATOR([xalloc]) 848 gl_MODULE_INDICATOR([xalloc])
801 gl_MODULE_INDICATOR([xalloc-die]) 849 gl_MODULE_INDICATOR([xalloc-die])
@@ -1002,7 +1050,7 @@ AC_DEFUN([gl_FILE_LIST], [
1002 lib/dynarray.h 1050 lib/dynarray.h
1003 lib/errno.in.h 1051 lib/errno.in.h
1004 lib/error.c 1052 lib/error.c
1005 lib/error.h 1053 lib/error.in.h
1006 lib/exitfail.c 1054 lib/exitfail.c
1007 lib/exitfail.h 1055 lib/exitfail.h
1008 lib/fcntl.c 1056 lib/fcntl.c
@@ -1062,6 +1110,12 @@ AC_DEFUN([gl_FILE_LIST], [
1062 lib/intprops-internal.h 1110 lib/intprops-internal.h
1063 lib/intprops.h 1111 lib/intprops.h
1064 lib/inttypes.in.h 1112 lib/inttypes.in.h
1113 lib/iswblank.c
1114 lib/iswctype-impl.h
1115 lib/iswctype.c
1116 lib/iswdigit.c
1117 lib/iswpunct.c
1118 lib/iswxdigit.c
1065 lib/itold.c 1119 lib/itold.c
1066 lib/langinfo.in.h 1120 lib/langinfo.in.h
1067 lib/lc-charset-dispatch.c 1121 lib/lc-charset-dispatch.c
@@ -1089,6 +1143,7 @@ AC_DEFUN([gl_FILE_LIST], [
1089 lib/mbrtowc-impl.h 1143 lib/mbrtowc-impl.h
1090 lib/mbrtowc.c 1144 lib/mbrtowc.c
1091 lib/mbsinit.c 1145 lib/mbsinit.c
1146 lib/mbszero.c
1092 lib/mbtowc-impl.h 1147 lib/mbtowc-impl.h
1093 lib/mbtowc-lock.c 1148 lib/mbtowc-lock.c
1094 lib/mbtowc-lock.h 1149 lib/mbtowc-lock.h
@@ -1124,6 +1179,7 @@ AC_DEFUN([gl_FILE_LIST], [
1124 lib/regexec.c 1179 lib/regexec.c
1125 lib/setenv.c 1180 lib/setenv.c
1126 lib/setlocale-lock.c 1181 lib/setlocale-lock.c
1182 lib/setlocale_null-unlocked.c
1127 lib/setlocale_null.c 1183 lib/setlocale_null.c
1128 lib/setlocale_null.h 1184 lib/setlocale_null.h
1129 lib/sha256-stream.c 1185 lib/sha256-stream.c
@@ -1138,7 +1194,6 @@ AC_DEFUN([gl_FILE_LIST], [
1138 lib/stat-w32.c 1194 lib/stat-w32.c
1139 lib/stat-w32.h 1195 lib/stat-w32.h
1140 lib/stat.c 1196 lib/stat.c
1141 lib/stdalign.in.h
1142 lib/stdckdint.in.h 1197 lib/stdckdint.in.h
1143 lib/stddef.in.h 1198 lib/stddef.in.h
1144 lib/stdint.in.h 1199 lib/stdint.in.h
@@ -1183,6 +1238,8 @@ AC_DEFUN([gl_FILE_LIST], [
1183 lib/wchar.in.h 1238 lib/wchar.in.h
1184 lib/wcrtomb.c 1239 lib/wcrtomb.c
1185 lib/wctype-h.c 1240 lib/wctype-h.c
1241 lib/wctype-impl.h
1242 lib/wctype.c
1186 lib/wctype.in.h 1243 lib/wctype.in.h
1187 lib/windows-initguard.h 1244 lib/windows-initguard.h
1188 lib/windows-mutex.c 1245 lib/windows-mutex.c
@@ -1220,9 +1277,11 @@ AC_DEFUN([gl_FILE_LIST], [
1220 m4/environ.m4 1277 m4/environ.m4
1221 m4/errno_h.m4 1278 m4/errno_h.m4
1222 m4/error.m4 1279 m4/error.m4
1280 m4/error_h.m4
1223 m4/exponentd.m4 1281 m4/exponentd.m4
1224 m4/extensions.m4 1282 m4/extensions.m4
1225 m4/extern-inline.m4 1283 m4/extern-inline.m4
1284 m4/fclose.m4
1226 m4/fcntl-o.m4 1285 m4/fcntl-o.m4
1227 m4/fcntl.m4 1286 m4/fcntl.m4
1228 m4/fcntl_h.m4 1287 m4/fcntl_h.m4
@@ -1257,6 +1316,11 @@ AC_DEFUN([gl_FILE_LIST], [
1257 m4/intmax_t.m4 1316 m4/intmax_t.m4
1258 m4/inttypes.m4 1317 m4/inttypes.m4
1259 m4/inttypes_h.m4 1318 m4/inttypes_h.m4
1319 m4/iswblank.m4
1320 m4/iswctype.m4
1321 m4/iswdigit.m4
1322 m4/iswpunct.m4
1323 m4/iswxdigit.m4
1260 m4/langinfo_h.m4 1324 m4/langinfo_h.m4
1261 m4/largefile.m4 1325 m4/largefile.m4
1262 m4/limits-h.m4 1326 m4/limits-h.m4
@@ -1284,6 +1348,7 @@ AC_DEFUN([gl_FILE_LIST], [
1284 m4/msvc-inval.m4 1348 m4/msvc-inval.m4
1285 m4/msvc-nothrow.m4 1349 m4/msvc-nothrow.m4
1286 m4/multiarch.m4 1350 m4/multiarch.m4
1351 m4/musl.m4
1287 m4/netdb_h.m4 1352 m4/netdb_h.m4
1288 m4/netinet_in_h.m4 1353 m4/netinet_in_h.m4
1289 m4/nl_langinfo.m4 1354 m4/nl_langinfo.m4
@@ -1346,6 +1411,7 @@ AC_DEFUN([gl_FILE_LIST], [
1346 m4/wchar_h.m4 1411 m4/wchar_h.m4
1347 m4/wchar_t.m4 1412 m4/wchar_t.m4
1348 m4/wcrtomb.m4 1413 m4/wcrtomb.m4
1414 m4/wctype.m4
1349 m4/wctype_h.m4 1415 m4/wctype_h.m4
1350 m4/wint_t.m4 1416 m4/wint_t.m4
1351 m4/xalloc.m4 1417 m4/xalloc.m4
diff --git a/gl/m4/gnulib-tool.m4 b/gl/m4/gnulib-tool.m4
index a9dd569b..ef45f51f 100644
--- a/gl/m4/gnulib-tool.m4
+++ b/gl/m4/gnulib-tool.m4
@@ -1,5 +1,6 @@
1# gnulib-tool.m4 serial 4 1# gnulib-tool.m4
2dnl Copyright (C) 2004-2005, 2009-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2004-2005, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/hostent.m4 b/gl/m4/hostent.m4
index 3b2cc2b2..36dc636e 100644
--- a/gl/m4/hostent.m4
+++ b/gl/m4/hostent.m4
@@ -1,5 +1,6 @@
1# hostent.m4 serial 4 1# hostent.m4
2dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2008, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -26,7 +27,7 @@ AC_DEFUN([gl_HOSTENT],
26 AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32], 27 AC_CACHE_CHECK([for gethostbyname in winsock2.h and -lws2_32],
27 [gl_cv_w32_gethostbyname], 28 [gl_cv_w32_gethostbyname],
28 [gl_cv_w32_gethostbyname=no 29 [gl_cv_w32_gethostbyname=no
29 gl_save_LIBS="$LIBS" 30 gl_saved_LIBS="$LIBS"
30 LIBS="$LIBS -lws2_32" 31 LIBS="$LIBS -lws2_32"
31 AC_LINK_IFELSE( 32 AC_LINK_IFELSE(
32 [AC_LANG_PROGRAM( 33 [AC_LANG_PROGRAM(
@@ -38,7 +39,7 @@ AC_DEFUN([gl_HOSTENT],
38 ]], 39 ]],
39 [[gethostbyname(NULL);]])], 40 [[gethostbyname(NULL);]])],
40 [gl_cv_w32_gethostbyname=yes]) 41 [gl_cv_w32_gethostbyname=yes])
41 LIBS="$gl_save_LIBS" 42 LIBS="$gl_saved_LIBS"
42 ]) 43 ])
43 if test "$gl_cv_w32_gethostbyname" = "yes"; then 44 if test "$gl_cv_w32_gethostbyname" = "yes"; then
44 HOSTENT_LIB="-lws2_32" 45 HOSTENT_LIB="-lws2_32"
diff --git a/gl/m4/idpriv.m4 b/gl/m4/idpriv.m4
index fc3dd17d..53693527 100644
--- a/gl/m4/idpriv.m4
+++ b/gl/m4/idpriv.m4
@@ -1,5 +1,6 @@
1# idpriv.m4 serial 1 1# idpriv.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/include_next.m4 b/gl/m4/include_next.m4
index 9f19215e..03e85251 100644
--- a/gl/m4/include_next.m4
+++ b/gl/m4/include_next.m4
@@ -1,5 +1,6 @@
1# include_next.m4 serial 26 1# include_next.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 27
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -74,17 +75,17 @@ EOF
74#endif 75#endif
75#define DEFINED_IN_CONFTESTD2 76#define DEFINED_IN_CONFTESTD2
76EOF 77EOF
77 gl_save_CPPFLAGS="$CPPFLAGS" 78 gl_saved_CPPFLAGS="$CPPFLAGS"
78 CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1b -Iconftestd2" 79 CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1b -Iconftestd2"
79dnl We intentionally avoid using AC_LANG_SOURCE here. 80dnl We intentionally avoid using AC_LANG_SOURCE here.
80 AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], 81 AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
81 [gl_cv_have_include_next=yes], 82 [gl_cv_have_include_next=yes],
82 [CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2" 83 [CPPFLAGS="$gl_saved_CPPFLAGS -Iconftestd1a -Iconftestd2"
83 AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]], 84 AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[#include <conftest.h>]],
84 [gl_cv_have_include_next=buggy], 85 [gl_cv_have_include_next=buggy],
85 [gl_cv_have_include_next=no]) 86 [gl_cv_have_include_next=no])
86 ]) 87 ])
87 CPPFLAGS="$gl_save_CPPFLAGS" 88 CPPFLAGS="$gl_saved_CPPFLAGS"
88 rm -rf conftestd1a conftestd1b conftestd2 89 rm -rf conftestd1a conftestd1b conftestd2
89 ]) 90 ])
90 PRAGMA_SYSTEM_HEADER= 91 PRAGMA_SYSTEM_HEADER=
diff --git a/gl/m4/inet_ntop.m4 b/gl/m4/inet_ntop.m4
index 48822d69..168e17e0 100644
--- a/gl/m4/inet_ntop.m4
+++ b/gl/m4/inet_ntop.m4
@@ -1,5 +1,6 @@
1# inet_ntop.m4 serial 21 1# inet_ntop.m4
2dnl Copyright (C) 2005-2006, 2008-2023 Free Software Foundation, Inc. 2# serial 22
3dnl Copyright (C) 2005-2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -36,14 +37,14 @@ AC_DEFUN([gl_FUNC_INET_NTOP],
36 HAVE_DECL_INET_NTOP=0 37 HAVE_DECL_INET_NTOP=0
37 fi 38 fi
38 else 39 else
39 gl_save_LIBS=$LIBS 40 gl_saved_LIBS=$LIBS
40 AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [], 41 AC_SEARCH_LIBS([inet_ntop], [nsl resolv network], [],
41 [AC_CHECK_FUNCS([inet_ntop]) 42 [AC_CHECK_FUNCS([inet_ntop])
42 if test $ac_cv_func_inet_ntop = no; then 43 if test $ac_cv_func_inet_ntop = no; then
43 HAVE_INET_NTOP=0 44 HAVE_INET_NTOP=0
44 fi 45 fi
45 ]) 46 ])
46 LIBS=$gl_save_LIBS 47 LIBS=$gl_saved_LIBS
47 48
48 if test "$ac_cv_search_inet_ntop" != "no" \ 49 if test "$ac_cv_search_inet_ntop" != "no" \
49 && test "$ac_cv_search_inet_ntop" != "none required"; then 50 && test "$ac_cv_search_inet_ntop" != "none required"; then
diff --git a/gl/m4/intmax_t.m4 b/gl/m4/intmax_t.m4
index ef32e1b9..72858ea8 100644
--- a/gl/m4/intmax_t.m4
+++ b/gl/m4/intmax_t.m4
@@ -1,5 +1,6 @@
1# intmax_t.m4 serial 9 1# intmax_t.m4
2dnl Copyright (C) 1997-2004, 2006-2007, 2009-2023 Free Software Foundation, 2# serial 9
3dnl Copyright (C) 1997-2004, 2006-2007, 2009-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/inttypes.m4 b/gl/m4/inttypes.m4
index bf2eab2b..c43cd162 100644
--- a/gl/m4/inttypes.m4
+++ b/gl/m4/inttypes.m4
@@ -1,5 +1,6 @@
1# inttypes.m4 serial 36 1# inttypes.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 37
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -170,6 +171,10 @@ AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
170 HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX]) 171 HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
171 HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX]) 172 HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
172 HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T]) 173 HAVE_IMAXDIV_T=1; AC_SUBST([HAVE_IMAXDIV_T])
174 HAVE_IMAXABS=1; AC_SUBST([HAVE_IMAXABS])
175 HAVE_IMAXDIV=1; AC_SUBST([HAVE_IMAXDIV])
176 REPLACE_IMAXABS=0; AC_SUBST([REPLACE_IMAXABS])
177 REPLACE_IMAXDIV=0; AC_SUBST([REPLACE_IMAXDIV])
173 REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX]) 178 REPLACE_STRTOIMAX=0; AC_SUBST([REPLACE_STRTOIMAX])
174 REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX]) 179 REPLACE_STRTOUMAX=0; AC_SUBST([REPLACE_STRTOUMAX])
175 INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX]) 180 INT32_MAX_LT_INTMAX_MAX=1; AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
diff --git a/gl/m4/inttypes_h.m4 b/gl/m4/inttypes_h.m4
index 68c60e9d..3b9da5b0 100644
--- a/gl/m4/inttypes_h.m4
+++ b/gl/m4/inttypes_h.m4
@@ -1,5 +1,6 @@
1# inttypes_h.m4 serial 10 1# inttypes_h.m4
2dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc. 2# serial 10
3dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/iswblank.m4 b/gl/m4/iswblank.m4
new file mode 100644
index 00000000..4dc12d9a
--- /dev/null
+++ b/gl/m4/iswblank.m4
@@ -0,0 +1,39 @@
1# iswblank.m4
2# serial 7
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWBLANK],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 dnl Persuade glibc <wctype.h> to declare iswblank().
13 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
14 gl_CHECK_FUNCS_ANDROID([iswblank], [[#include <wctype.h>]])
15 AC_CHECK_DECLS([iswblank], , , [[
16 #include <wchar.h>
17 #include <wctype.h>
18 ]])
19 if test $ac_cv_func_iswblank = no; then
20 HAVE_ISWBLANK=0
21 if test $ac_cv_have_decl_iswblank = yes \
22 || case "$gl_cv_onwards_func_iswblank" in \
23 future*) true ;; \
24 *) false ;; \
25 esac; then
26 REPLACE_ISWBLANK=1
27 fi
28 fi
29 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
30 dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
31 :
32 else
33 if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
34 dnl Redefine only iswblank.
35 :
36 fi
37 fi
38
39])
diff --git a/gl/m4/iswctype.m4 b/gl/m4/iswctype.m4
new file mode 100644
index 00000000..16031be4
--- /dev/null
+++ b/gl/m4/iswctype.m4
@@ -0,0 +1,14 @@
1# iswctype.m4
2# serial 3
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWCTYPE],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 dnl Determine REPLACE_WCTYPE.
13 AC_REQUIRE([gl_FUNC_WCTYPE])
14])
diff --git a/gl/m4/iswdigit.m4 b/gl/m4/iswdigit.m4
new file mode 100644
index 00000000..999acd28
--- /dev/null
+++ b/gl/m4/iswdigit.m4
@@ -0,0 +1,121 @@
1# iswdigit.m4
2# serial 7
3dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWDIGIT],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([gt_LOCALE_FR])
13 AC_REQUIRE([gt_LOCALE_JA])
14 AC_REQUIRE([gt_LOCALE_FR_UTF8])
15 AC_REQUIRE([gt_LOCALE_ZH_CN])
16 AC_REQUIRE([AC_CANONICAL_HOST])
17
18 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
19 dnl <wctype.h> redefines iswdigit already.
20 REPLACE_ISWDIGIT="$REPLACE_ISWCNTRL"
21 else
22 AC_CACHE_CHECK([whether iswdigit is ISO C compliant],
23 [gl_cv_func_iswdigit_works],
24 [
25 dnl Initial guess, used when cross-compiling or when no suitable locale
26 dnl is present.
27changequote(,)dnl
28 case "$host_os" in
29 # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
30 freebsd* | dragonfly* | netbsd* | solaris* | mingw* | windows*)
31 gl_cv_func_iswdigit_works="guessing no" ;;
32 # Guess yes otherwise.
33 *) gl_cv_func_iswdigit_works="guessing yes" ;;
34 esac
35changequote([,])dnl
36 if test $LOCALE_FR != none || test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
37 AC_RUN_IFELSE(
38 [AC_LANG_SOURCE([[
39#include <locale.h>
40#include <stdlib.h>
41#include <string.h>
42#include <wchar.h>
43#include <wctype.h>
44
45/* Returns the value of iswdigit for the multibyte character s[0..n-1]. */
46static int
47for_character (const char *s, size_t n)
48{
49 mbstate_t state;
50 wchar_t wc;
51 size_t ret;
52
53 memset (&state, '\0', sizeof (mbstate_t));
54 wc = (wchar_t) 0xBADFACE;
55 ret = mbrtowc (&wc, s, n, &state);
56 if (ret != n)
57 abort ();
58
59 return iswdigit (wc);
60}
61
62int
63main (int argc, char *argv[])
64{
65 int is;
66 int result = 0;
67
68 if (strcmp ("$LOCALE_FR", "none") != 0
69 && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
70 {
71 /* This fails on mingw, MSVC 14. */
72 /* U+00B2 SUPERSCRIPT TWO */
73 is = for_character ("\262", 1);
74 if (!(is == 0))
75 result |= 1;
76 }
77 if (strcmp ("$LOCALE_JA", "none") != 0
78 && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
79 {
80 /* This fails on NetBSD 10.0. */
81 /* U+FF11 FULLWIDTH DIGIT ONE */
82 is = for_character ("\243\261", 2);
83 if (!(is == 0))
84 result |= 2;
85 }
86 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
87 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
88 {
89 /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14. */
90 /* U+0663 ARABIC-INDIC DIGIT THREE */
91 is = for_character ("\331\243", 2);
92 if (!(is == 0))
93 result |= 4;
94 /* This fails on FreeBSD 13.0, NetBSD 10.0, MSVC 14. */
95 /* U+FF11 FULLWIDTH DIGIT ONE */
96 is = for_character ("\357\274\221", 3);
97 if (!(is == 0))
98 result |= 8;
99 }
100 if (strcmp ("$LOCALE_ZH_CN", "none") != 0
101 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
102 {
103 /* This fails on NetBSD 10.0, Solaris 10, Solaris 11.4. */
104 /* U+FF11 FULLWIDTH DIGIT ONE */
105 is = for_character ("\243\261", 2);
106 if (!(is == 0))
107 result |= 16;
108 }
109 return result;
110}]])],
111 [gl_cv_func_iswdigit_works=yes],
112 [gl_cv_func_iswdigit_works=no],
113 [:])
114 fi
115 ])
116 case "$gl_cv_func_iswdigit_works" in
117 *yes) ;;
118 *) REPLACE_ISWDIGIT=1 ;;
119 esac
120 fi
121])
diff --git a/gl/m4/iswpunct.m4 b/gl/m4/iswpunct.m4
new file mode 100644
index 00000000..1edf58aa
--- /dev/null
+++ b/gl/m4/iswpunct.m4
@@ -0,0 +1,49 @@
1# iswpunct.m4
2# serial 2
3dnl Copyright (C) 2023-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWPUNCT],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13
14 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
15 dnl <wctype.h> redefines iswpunct already.
16 REPLACE_ISWPUNCT="$REPLACE_ISWCNTRL"
17 else
18 AC_CACHE_CHECK([whether iswpunct is consistent with ispunct],
19 [gl_cv_func_iswpunct_works],
20 [AC_RUN_IFELSE(
21 [AC_LANG_SOURCE([[
22#include <ctype.h>
23#include <wchar.h>
24#include <wctype.h>
25int
26main (int argc, char *argv[])
27{
28 int result = 0;
29 /* This fails on Android 11. */
30 if ((! iswpunct ('\`')) != (! ispunct ('\`')))
31 result |= 1;
32 return result;
33}]])],
34 [gl_cv_func_iswpunct_works=yes],
35 [gl_cv_func_iswpunct_works=no],
36 [case "$host_os" in
37 # Guess no on Android.
38 android*) gl_cv_func_iswpunct_works="guessing no" ;;
39 # Guess yes otherwise.
40 *) gl_cv_func_iswpunct_works="guessing yes" ;;
41 esac
42 ])
43 ])
44 case "$gl_cv_func_iswpunct_works" in
45 *yes) ;;
46 *) REPLACE_ISWPUNCT=1 ;;
47 esac
48 fi
49])
diff --git a/gl/m4/iswxdigit.m4 b/gl/m4/iswxdigit.m4
new file mode 100644
index 00000000..6085bf6b
--- /dev/null
+++ b/gl/m4/iswxdigit.m4
@@ -0,0 +1,111 @@
1# iswxdigit.m4
2# serial 7
3dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN([gl_FUNC_ISWXDIGIT],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([gt_LOCALE_JA])
13 AC_REQUIRE([gt_LOCALE_FR_UTF8])
14 AC_REQUIRE([gt_LOCALE_ZH_CN])
15 AC_REQUIRE([AC_CANONICAL_HOST])
16
17 if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
18 dnl <wctype.h> redefines iswxdigit already.
19 REPLACE_ISWXDIGIT="$REPLACE_ISWCNTRL"
20 else
21 AC_CACHE_CHECK([whether iswxdigit is ISO C compliant],
22 [gl_cv_func_iswxdigit_works],
23 [
24 dnl Initial guess, used when cross-compiling or when no suitable locale
25 dnl is present.
26changequote(,)dnl
27 case "$host_os" in
28 # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
29 freebsd* | dragonfly* | netbsd* | solaris* | mingw* | windows*)
30 gl_cv_func_iswxdigit_works="guessing no" ;;
31 # Guess yes otherwise.
32 *) gl_cv_func_iswxdigit_works="guessing yes" ;;
33 esac
34changequote([,])dnl
35 if test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
36 AC_RUN_IFELSE(
37 [AC_LANG_SOURCE([[
38#include <locale.h>
39#include <stdlib.h>
40#include <string.h>
41#include <wchar.h>
42#include <wctype.h>
43
44/* Returns the value of iswxdigit for the multibyte character s[0..n-1]. */
45static int
46for_character (const char *s, size_t n)
47{
48 mbstate_t state;
49 wchar_t wc;
50 size_t ret;
51
52 memset (&state, '\0', sizeof (mbstate_t));
53 wc = (wchar_t) 0xBADFACE;
54 ret = mbrtowc (&wc, s, n, &state);
55 if (ret != n)
56 abort ();
57
58 return iswxdigit (wc);
59}
60
61int
62main (int argc, char *argv[])
63{
64 int is;
65 int result = 0;
66
67 if (strcmp ("$LOCALE_JA", "none") != 0
68 && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
69 {
70 /* This fails on NetBSD 10.0. */
71 /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
72 is = for_character ("\243\301", 2);
73 if (!(is == 0))
74 result |= 1;
75 }
76 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
77 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
78 {
79 /* This fails on FreeBSD 13.0. */
80 /* U+0663 ARABIC-INDIC DIGIT THREE */
81 is = for_character ("\331\243", 2);
82 if (!(is == 0))
83 result |= 2;
84 /* This fails on NetBSD 10.0, MSVC 14. */
85 /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
86 is = for_character ("\357\274\241", 3);
87 if (!(is == 0))
88 result |= 4;
89 }
90 if (strcmp ("$LOCALE_ZH_CN", "none") != 0
91 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
92 {
93 /* This fails on Solaris 10, Solaris 11.4. */
94 /* U+FF11 FULLWIDTH DIGIT ONE */
95 is = for_character ("\243\261", 2);
96 if (!(is == 0))
97 result |= 8;
98 }
99 return result;
100}]])],
101 [gl_cv_func_iswxdigit_works=yes],
102 [gl_cv_func_iswxdigit_works=no],
103 [:])
104 fi
105 ])
106 case "$gl_cv_func_iswxdigit_works" in
107 *yes) ;;
108 *) REPLACE_ISWXDIGIT=1 ;;
109 esac
110 fi
111])
diff --git a/gl/m4/langinfo_h.m4 b/gl/m4/langinfo_h.m4
index b17a526a..5eee8a71 100644
--- a/gl/m4/langinfo_h.m4
+++ b/gl/m4/langinfo_h.m4
@@ -1,5 +1,6 @@
1# langinfo_h.m4 serial 12 1# langinfo_h.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/largefile.m4 b/gl/m4/largefile.m4
index 7fb81b86..2f824089 100644
--- a/gl/m4/largefile.m4
+++ b/gl/m4/largefile.m4
@@ -1,16 +1,18 @@
1# largefile.m4
2# serial 1
3dnl Copyright 1992-1996, 1998-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
1# Enable large files on systems where this is not the default. 8# Enable large files on systems where this is not the default.
2# Enable support for files on Linux file systems with 64-bit inode numbers. 9# Enable support for files on Linux file systems with 64-bit inode numbers.
3 10
4# Copyright 1992-1996, 1998-2023 Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO: 11# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
10# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this 12# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
11# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko 13# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
12# and ftello in C++ mode as well. 14# and ftello in C++ mode as well.
13# Fixed in Autoconf 2.72, which has AC_SYS_YEAR2038. 15# This problem occurs in Autoconf 2.71 and earlier, which lack AC_SYS_YEAR2038.
14AC_DEFUN([gl_SET_LARGEFILE_SOURCE], 16AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
15 m4_ifndef([AC_SYS_YEAR2038], [[ 17 m4_ifndef([AC_SYS_YEAR2038], [[
16 AC_REQUIRE([AC_CANONICAL_HOST]) 18 AC_REQUIRE([AC_CANONICAL_HOST])
@@ -24,29 +26,20 @@ AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
24 ]]) 26 ]])
25) 27)
26 28
27# Work around a problem in autoconf <= 2.69: 29dnl Remove AC_SYS_YEAR2038_RECOMMENDED if unpatched Autoconf 2.72 or earlier.
28# AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5, 30dnl Autoconf 2.72 still uses -n32, which is not a C preprocessor option,
29# or configures them incorrectly in some cases. 31dnl and which was useful only on IRIX which is no longer supported.
30m4_version_prereq([2.70], [], [ 32dnl This should be fixed in Autoconf 2.73.
31 33m4_ifdef([AC_SYS_YEAR2038_RECOMMENDED],
32# _AC_SYS_LARGEFILE_TEST_INCLUDES 34 [m4_bmatch(m4_ifdef([_AC_SYS_LARGEFILE_OPTIONS],
33# ------------------------------- 35 [m4_defn([_AC_SYS_LARGEFILE_OPTIONS])],
34m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], 36 ["-n32"]),
35[#include <sys/types.h> 37 ["-n32"],
36 /* Check that off_t can represent 2**63 - 1 correctly. 38 [m4_undefine([AC_SYS_YEAR2038_RECOMMENDED])])])
37 We can't simply define LARGE_OFF_T to be 9223372036854775807,
38 since some C++ compilers masquerading as C compilers
39 incorrectly reject 9223372036854775807. */
40#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
41 int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
42 && LARGE_OFF_T % 2147483647 == 1)
43 ? 1 : -1]];[]dnl
44])
45])# m4_version_prereq 2.70
46 39
47# Support AC_SYS_YEAR2038, even if Autoconf 2.71 or earlier. 40m4_ifndef([AC_SYS_YEAR2038_RECOMMENDED], [
48# This code is taken from Autoconf master. 41# Fix up AC_SYS_YEAR2038_RECOMMENDED and related macros, even if
49m4_ifndef([AC_SYS_YEAR2038], [ 42# unpatched Autoconf 2.72 or earlier. This code is taken from Autoconf master.
50 43
51# _AC_SYS_YEAR2038_TEST_CODE 44# _AC_SYS_YEAR2038_TEST_CODE
52# -------------------------- 45# --------------------------
@@ -78,8 +71,8 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
78 dnl 32-bit MinGW (misconfiguration) 71 dnl 32-bit MinGW (misconfiguration)
79)) 72))
80 73
81# _AC_SYS_YEAR2038_PROBE([IF-NOT-DETECTED]) 74# _AC_SYS_YEAR2038_PROBE
82# ----------------------------------------- 75# ----------------------
83# Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent 76# Subroutine of AC_SYS_YEAR2038. Probe for time_t that can represent
84# time points more than 2**31 - 1 seconds after the epoch (dates after 77# time points more than 2**31 - 1 seconds after the epoch (dates after
85# 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts 78# 2038-01-18, see above) and set the cache variable ac_cv_sys_year2038_opts
@@ -92,13 +85,10 @@ m4_define([_AC_SYS_YEAR2038_OPTIONS], m4_normalize(
92# AC_TRY_RUN. Note also that some systems only support large time_t 85# AC_TRY_RUN. Note also that some systems only support large time_t
93# together with large off_t. 86# together with large off_t.
94# 87#
95# If support is not detected, the behavior depends on which of the
96# top-level AC_SYS_YEAR2038 macros was used (see below).
97#
98# If you change this macro you may also need to change 88# If you change this macro you may also need to change
99# _AC_SYS_YEAR2038_OPTIONS. 89# _AC_SYS_YEAR2038_OPTIONS.
100AC_DEFUN([_AC_SYS_YEAR2038_PROBE], 90AC_DEFUN([_AC_SYS_YEAR2038_PROBE],
101[AC_CACHE_CHECK([for $CC option to enable timestamps after Jan 2038], 91[AC_CACHE_CHECK([for $CPPFLAGS option for timestamps after 2038],
102 [ac_cv_sys_year2038_opts], 92 [ac_cv_sys_year2038_opts],
103 [ac_save_CPPFLAGS="$CPPFLAGS" 93 [ac_save_CPPFLAGS="$CPPFLAGS"
104 ac_opt_found=no 94 ac_opt_found=no
@@ -117,40 +107,20 @@ ac_have_year2038=yes
117AS_CASE([$ac_cv_sys_year2038_opts], 107AS_CASE([$ac_cv_sys_year2038_opts],
118 ["none needed"], [], 108 ["none needed"], [],
119 ["support not detected"], 109 ["support not detected"],
120 [ac_have_year2038=no 110 [ac_have_year2038=no],
121 AS_CASE([$enable_year2038],
122 [yes],
123 [# If we're not cross compiling and 'touch' works with a large
124 # timestamp, then we can presume the system supports wider time_t
125 # *somehow* and we just weren't able to detect it. One common
126 # case that we deliberately *don't* probe for is a system that
127 # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
128 # wide time_t. (It would be inappropriate for us to override an
129 # intentional use of -m32.) Error out, demanding use of
130 # --disable-year2038 if this is intentional.
131 AS_IF([test $cross_compiling = no],
132 [AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
133 [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
134 [*'Feb 7 2106'* | *'Feb 7 17:10'*],
135 [AC_MSG_FAILURE(m4_text_wrap(
136 [this system appears to support timestamps after January 2038,
137 but no mechanism for enabling wide 'time_t' was detected.
138 Did you mean to build a 64-bit binary? (e.g. 'CC="${CC} -m64"'.)
139 To proceed with 32-bit time_t, configure with '--disable-year2038'.],
140 [], [], [55]))])])])])],
141 111
142 ["-D_TIME_BITS=64"], 112 ["-D_TIME_BITS=64"],
143 [AC_DEFINE([_TIME_BITS], [64], 113 [AC_DEFINE([_TIME_BITS], [64],
144 [Number of bits in time_t, on hosts where this is settable.])], 114 [Number of bits in time_t, on hosts where this is settable.])],
145 115
146 ["-D__MINGW_USE_VC2005_COMPAT=1"], 116 ["-D__MINGW_USE_VC2005_COMPAT"],
147 [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1], 117 [AC_DEFINE([__MINGW_USE_VC2005_COMPAT], [1],
148 [Define to 1 on platforms where this makes time_t a 64-bit type.])], 118 [Define to 1 on platforms where this makes time_t a 64-bit type.])],
149 119
150 ["-U_USE_32_BIT_TIME_T"*], 120 ["-U_USE_32_BIT_TIME_T"*],
151 [AC_MSG_FAILURE(m4_text_wrap( 121 [AC_MSG_FAILURE(m4_text_wrap(
152 [the 'time_t' type is currently forced to be 32-bit. 122 [the 'time_t' type is currently forced to be 32-bit.
153 It will stop working after January 2038. 123 It will stop working after mid-January 2038.
154 Remove _USE_32BIT_TIME_T from the compiler flags.], 124 Remove _USE_32BIT_TIME_T from the compiler flags.],
155 [], [], [55]))], 125 [], [], [55]))],
156 126
@@ -160,12 +130,11 @@ AS_CASE([$ac_cv_sys_year2038_opts],
160 130
161# _AC_SYS_YEAR2038_ENABLE 131# _AC_SYS_YEAR2038_ENABLE
162# ----------------------- 132# -----------------------
163# Subroutine of AC_SYS_YEAR2038 and _AC_SYS_YEAR2038_OPT_IN.
164# Depending on which of the YEAR2038 macros was used, add either an 133# Depending on which of the YEAR2038 macros was used, add either an
165# --enable-year2038, or a --disable-year2038, or no option at all to 134# --enable-year2038 or a --disable-year2038 to
166# the configure script. Note that this is expanded very late and 135# the configure script. This is expanded very late and
167# therefore there cannot be any code in the AC_ARG_ENABLE. The 136# therefore there cannot be any code in the AC_ARG_ENABLE. The
168# default value for enable_year2038 is emitted unconditionally 137# default value for 'enable_year2038' is emitted unconditionally
169# because the generated code always looks at this variable. 138# because the generated code always looks at this variable.
170m4_define([_AC_SYS_YEAR2038_ENABLE], 139m4_define([_AC_SYS_YEAR2038_ENABLE],
171[m4_divert_text([DEFAULTS], 140[m4_divert_text([DEFAULTS],
@@ -175,50 +144,70 @@ m4_define([_AC_SYS_YEAR2038_ENABLE],
175[AC_ARG_ENABLE([year2038], 144[AC_ARG_ENABLE([year2038],
176 m4_provide_if([AC_SYS_YEAR2038], 145 m4_provide_if([AC_SYS_YEAR2038],
177 [AS_HELP_STRING([--disable-year2038], 146 [AS_HELP_STRING([--disable-year2038],
178 [do not support timestamps after 2038])], 147 [don't support timestamps after 2038])],
179 [AS_HELP_STRING([--enable-year2038], 148 [AS_HELP_STRING([--enable-year2038],
180 [support timestamps after 2038])]))]) 149 [support timestamps after 2038])]))])
181 150
182# _AC_SYS_YEAR2038_OPT_IN
183# -----------------------
184# If the --enable-year2038 option is given to configure, attempt to
185# detect and activate support for large time_t on 32-bit systems.
186# This macro is automatically invoked by AC_SYS_LARGEFILE when large
187# *file* support is detected. It does not AC_REQUIRE AC_SYS_LARGEFILE
188# to avoid a dependency loop, and is therefore unsafe to expose as a
189# documented macro.
190AC_DEFUN([_AC_SYS_YEAR2038_OPT_IN],
191[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl
192 AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE])
193 AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])
194])])
195
196# AC_SYS_YEAR2038 151# AC_SYS_YEAR2038
197# --------------- 152# ---------------
198# Attempt to detect and activate support for large time_t. 153# Attempt to detect and activate support for large time_t.
199# On systems where time_t is not always 64 bits, this probe can be 154# On systems where time_t is not always 64 bits, this probe can be
200# skipped by passing the --disable-year2038 option to configure. 155# skipped by passing the --disable-year2038 option to configure.
201AC_DEFUN([AC_SYS_YEAR2038], 156AC_DEFUN([AC_SYS_YEAR2038],
202[AC_REQUIRE([AC_SYS_LARGEFILE])]dnl 157[AC_REQUIRE([AC_SYS_LARGEFILE])dnl
203[m4_provide_if([_AC_SYS_YEAR2038_PROBE], [], [dnl 158AS_IF([test "$enable_year2038,$ac_have_year2038,$cross_compiling" = yes,no,no],
204 AS_IF([test "$enable_year2038" != no], [_AC_SYS_YEAR2038_PROBE]) 159 [# If we're not cross compiling and 'touch' works with a large
205 AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE]) 160 # timestamp, then we can presume the system supports wider time_t
206])]) 161 # *somehow* and we just weren't able to detect it. One common
162 # case that we deliberately *don't* probe for is a system that
163 # supports both 32- and 64-bit ABIs but only the 64-bit ABI offers
164 # wide time_t. (It would be inappropriate for us to override an
165 # intentional use of -m32.) Error out, demanding use of
166 # --disable-year2038 if this is intentional.
167 AS_IF([TZ=UTC0 touch -t 210602070628.15 conftest.time 2>/dev/null],
168 [AS_CASE([`TZ=UTC0 LC_ALL=C ls -l conftest.time 2>/dev/null`],
169 [*'Feb 7 2106'* | *'Feb 7 17:10'*],
170 [AC_MSG_FAILURE(m4_text_wrap(
171 [this system appears to support timestamps after mid-January 2038,
172 but no mechanism for enabling wide 'time_t' was detected.
173 Did you mean to build a 64-bit binary? (E.g., 'CC="${CC} -m64"'.)
174 To proceed with 32-bit time_t, configure with '--disable-year2038'.],
175 [], [], [55]))])])])])
176
177# AC_SYS_YEAR2038_RECOMMENDED
178# ---------------------------
179# Same as AC_SYS_YEAR2038, but recommend support for large time_t.
180# If we cannot find any way to make time_t capable of representing
181# values larger than 2**31 - 1, error out unless --disable-year2038 is given.
182AC_DEFUN([AC_SYS_YEAR2038_RECOMMENDED],
183[AC_REQUIRE([AC_SYS_YEAR2038])dnl
184AS_IF([test "$enable_year2038,$ac_have_year2038" = yes,no],
185 [AC_MSG_FAILURE(m4_text_wrap(
186 [could not enable timestamps after mid-January 2038.
187 This package recommends support for these later timestamps.
188 However, to proceed with signed 32-bit time_t even though it
189 will fail then, configure with '--disable-year2038'.],
190 [], [], [55]))])])
207 191
208# _AC_SYS_LARGEFILE_TEST_CODE 192# _AC_SYS_LARGEFILE_TEST_CODE
209# --------------------------- 193# ---------------------------
210# C code used to probe for large file support. 194# C code used to probe for large file support.
211m4_define([_AC_SYS_LARGEFILE_TEST_CODE], 195m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
212[@%:@include <sys/types.h> 196[@%:@include <sys/types.h>
213 /* Check that off_t can represent 2**63 - 1 correctly. 197@%:@ifndef FTYPE
214 We can't simply define LARGE_OFF_T to be 9223372036854775807, 198@%:@ define FTYPE off_t
199@%:@endif
200 /* Check that FTYPE can represent 2**63 - 1 correctly.
201 We can't simply define LARGE_FTYPE to be 9223372036854775807,
215 since some C++ compilers masquerading as C compilers 202 since some C++ compilers masquerading as C compilers
216 incorrectly reject 9223372036854775807. */ 203 incorrectly reject 9223372036854775807. */
217@%:@define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) 204@%:@define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31))
218 int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721 205 int FTYPE_is_large[[(LARGE_FTYPE % 2147483629 == 721
219 && LARGE_OFF_T % 2147483647 == 1) 206 && LARGE_FTYPE % 2147483647 == 1)
220 ? 1 : -1]];[]dnl 207 ? 1 : -1]];[]dnl
221]) 208])
209# Defined by Autoconf 2.71 and circa 2022 Gnulib unwisely depended on it.
210m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES], [_AC_SYS_LARGEFILE_TEST_CODE])
222 211
223# _AC_SYS_LARGEFILE_OPTIONS 212# _AC_SYS_LARGEFILE_OPTIONS
224# ------------------------- 213# -------------------------
@@ -228,8 +217,7 @@ m4_define([_AC_SYS_LARGEFILE_TEST_CODE],
228m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize( 217m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
229 ["none needed"] dnl Most current systems 218 ["none needed"] dnl Most current systems
230 ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec 219 ["-D_FILE_OFFSET_BITS=64"] dnl X/Open LFS spec
231 ["-D_LARGE_FILES=1"] dnl AIX (which versions?) 220 ["-D_LARGE_FILES=1"] dnl 32-bit AIX 4.2.1+, 32-bit z/OS
232 ["-n32"] dnl Irix 6.2 w/ SGI compiler
233)) 221))
234 222
235# _AC_SYS_LARGEFILE_PROBE 223# _AC_SYS_LARGEFILE_PROBE
@@ -246,24 +234,43 @@ m4_define([_AC_SYS_LARGEFILE_OPTIONS], m4_normalize(
246# If you change this macro you may also need to change 234# If you change this macro you may also need to change
247# _AC_SYS_LARGEFILE_OPTIONS. 235# _AC_SYS_LARGEFILE_OPTIONS.
248AC_DEFUN([_AC_SYS_LARGEFILE_PROBE], 236AC_DEFUN([_AC_SYS_LARGEFILE_PROBE],
249[AC_CACHE_CHECK([for $CC option to enable large file support], 237[AC_CACHE_CHECK([for $CPPFLAGS option for large files],
250 [ac_cv_sys_largefile_opts], 238 [ac_cv_sys_largefile_opts],
251 [ac_save_CC="$CC" 239 [ac_save_CPPFLAGS=$CPPFLAGS
252 ac_opt_found=no 240 ac_opt_found=no
253 for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do 241 for ac_opt in _AC_SYS_LARGEFILE_OPTIONS; do
254 AS_IF([test x"$ac_opt" != x"none needed"], 242 AS_IF([test x"$ac_opt" != x"none needed"],
255 [CC="$ac_save_CC $ac_opt"]) 243 [CPPFLAGS="$ac_save_CPPFLAGS $ac_opt"])
256 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])], 244 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_AC_SYS_LARGEFILE_TEST_CODE])],
257 [ac_cv_sys_largefile_opts="$ac_opt" 245 [AS_IF([test x"$ac_opt" = x"none needed"],
246 [# GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t.
247 CPPFLAGS="$CPPFLAGS -DFTYPE=ino_t"
248 AC_COMPILE_IFELSE([], [],
249 [CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=64"
250 AC_COMPILE_IFELSE([], [ac_opt='-D_FILE_OFFSET_BITS=64'])])])
251 ac_cv_sys_largefile_opts=$ac_opt
258 ac_opt_found=yes]) 252 ac_opt_found=yes])
259 test $ac_opt_found = no || break 253 test $ac_opt_found = no || break
260 done 254 done
261 CC="$ac_save_CC" 255 CPPFLAGS=$ac_save_CPPFLAGS
256 dnl Gnulib implements large file support for native Windows, based on the
257 dnl variables WINDOWS_64_BIT_OFF_T, WINDOWS_64_BIT_ST_SIZE.
258 m4_ifdef([gl_LARGEFILE], [
259 AC_REQUIRE([AC_CANONICAL_HOST])
260 if test $ac_opt_found != yes; then
261 AS_CASE([$host_os],
262 [mingw* | windows*],
263 [ac_cv_sys_largefile_opts="supported through gnulib"
264 ac_opt_found=yes]
265 )
266 fi
267 ])
262 test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"]) 268 test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected"])
263 269
264ac_have_largefile=yes 270ac_have_largefile=yes
265AS_CASE([$ac_cv_sys_largefile_opts], 271AS_CASE([$ac_cv_sys_largefile_opts],
266 ["none needed"], [], 272 ["none needed"], [],
273 ["supported through gnulib"], [],
267 ["support not detected"], 274 ["support not detected"],
268 [ac_have_largefile=no], 275 [ac_have_largefile=no],
269 276
@@ -275,27 +282,12 @@ AS_CASE([$ac_cv_sys_largefile_opts],
275 [AC_DEFINE([_LARGE_FILES], [1], 282 [AC_DEFINE([_LARGE_FILES], [1],
276 [Define to 1 on platforms where this makes off_t a 64-bit type.])], 283 [Define to 1 on platforms where this makes off_t a 64-bit type.])],
277 284
278 ["-n32"],
279 [CC="$CC -n32"],
280
281 [AC_MSG_ERROR( 285 [AC_MSG_ERROR(
282 [internal error: bad value for \$ac_cv_sys_largefile_opts])]) 286 [internal error: bad value for \$ac_cv_sys_largefile_opts])])
283 287
284_AC_SYS_YEAR2038_OPT_IN 288AS_IF([test "$enable_year2038" != no],
285]) 289 [_AC_SYS_YEAR2038_PROBE])
286 290AC_CONFIG_COMMANDS_PRE([_AC_SYS_YEAR2038_ENABLE])])
287# _AC_SYS_LARGEFILE_ENABLE
288# ------------------------
289# Subroutine of AC_SYS_LARGEFILE. Note that this
290# is expanded very late and therefore there cannot be any code in the
291# AC_ARG_ENABLE. The default value for enable_largefile is emitted
292# unconditionally because the generated shell code always looks at
293# this variable.
294m4_define([_AC_SYS_LARGEFILE_ENABLE],
295[m4_divert_text([DEFAULTS],
296 enable_largefile=yes)]dnl
297[AC_ARG_ENABLE([largefile],
298 [AS_HELP_STRING([--disable-largefile], [omit support for large files])])])
299 291
300# AC_SYS_LARGEFILE 292# AC_SYS_LARGEFILE
301# ---------------- 293# ----------------
@@ -306,14 +298,13 @@ m4_define([_AC_SYS_LARGEFILE_ENABLE],
306# Additionally, on Linux file systems with 64-bit inodes a file that happens 298# Additionally, on Linux file systems with 64-bit inodes a file that happens
307# to have a 64-bit inode number cannot be accessed by 32-bit applications on 299# to have a 64-bit inode number cannot be accessed by 32-bit applications on
308# Linux x86/x86_64. This can occur with file systems such as XFS and NFS. 300# Linux x86/x86_64. This can occur with file systems such as XFS and NFS.
309# This macro allows configuration to continue if the system doesn't support
310# large files.
311AC_DEFUN([AC_SYS_LARGEFILE], 301AC_DEFUN([AC_SYS_LARGEFILE],
312[m4_provide_if([_AC_SYS_LARGEFILE_PROBE], [], [dnl 302[AC_ARG_ENABLE([largefile],
313 AS_IF([test "$enable_largefile" != no], [_AC_SYS_LARGEFILE_PROBE]) 303 [AS_HELP_STRING([--disable-largefile],
314 AC_CONFIG_COMMANDS_PRE([_AC_SYS_LARGEFILE_ENABLE]) 304 [omit support for large files])])dnl
315])]) 305AS_IF([test "$enable_largefile,$enable_year2038" != no,no],
316])# m4_ifndef AC_SYS_YEAR2038 306 [_AC_SYS_LARGEFILE_PROBE])])
307])# m4_ifndef AC_SYS_YEAR2038_RECOMMENDED
317 308
318# Enable large files on systems where this is implemented by Gnulib, not by the 309# Enable large files on systems where this is implemented by Gnulib, not by the
319# system headers. 310# system headers.
@@ -323,7 +314,7 @@ AC_DEFUN([gl_LARGEFILE],
323[ 314[
324 AC_REQUIRE([AC_CANONICAL_HOST]) 315 AC_REQUIRE([AC_CANONICAL_HOST])
325 case "$host_os" in 316 case "$host_os" in
326 mingw*) 317 mingw* | windows*)
327 dnl Native Windows. 318 dnl Native Windows.
328 dnl mingw64 defines off_t to a 64-bit type already, if 319 dnl mingw64 defines off_t to a 64-bit type already, if
329 dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE. 320 dnl _FILE_OFFSET_BITS=64, which is ensured by AC_SYS_LARGEFILE.
diff --git a/gl/m4/limits-h.m4 b/gl/m4/limits-h.m4
index 5088fa16..1b619e1e 100644
--- a/gl/m4/limits-h.m4
+++ b/gl/m4/limits-h.m4
@@ -1,10 +1,12 @@
1dnl Check whether limits.h has needed features. 1# limits-h.m4
2 2# serial 1
3dnl Copyright 2016-2023 Free Software Foundation, Inc. 3dnl Copyright 2016-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl Check whether limits.h has needed features.
9
8dnl From Paul Eggert. 10dnl From Paul Eggert.
9 11
10AC_DEFUN_ONCE([gl_LIMITS_H], 12AC_DEFUN_ONCE([gl_LIMITS_H],
@@ -23,14 +25,27 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
23 int wb = WORD_BIT; 25 int wb = WORD_BIT;
24 int ullw = ULLONG_WIDTH; 26 int ullw = ULLONG_WIDTH;
25 int bw = BOOL_WIDTH; 27 int bw = BOOL_WIDTH;
28 int bm = BOOL_MAX;
29 int mblm = MB_LEN_MAX;
26 ]])], 30 ]])],
27 [gl_cv_header_limits_width=yes], 31 [gl_cv_header_limits_width=yes],
28 [gl_cv_header_limits_width=no])]) 32 [gl_cv_header_limits_width=no])])
29 if test "$gl_cv_header_limits_width" = yes; then 33 GL_GENERATE_LIMITS_H=true
30 GL_GENERATE_LIMITS_H=false 34 AS_IF([test "$gl_cv_header_limits_width" = yes],
31 else 35 [AC_CACHE_CHECK([whether limits.h has SSIZE_MAX],
32 GL_GENERATE_LIMITS_H=true 36 [gl_cv_header_limits_ssize_max],
33 fi 37 [AC_COMPILE_IFELSE(
38 [AC_LANG_SOURCE(
39 [[#include <limits.h>
40 #ifndef SSIZE_MAX
41 #error "SSIZE_MAX is not defined"
42 #endif
43 ]])],
44 [gl_cv_header_limits_ssize_max=yes],
45 [gl_cv_header_limits_ssize_max=no])])
46 if test "$gl_cv_header_limits_ssize_max" = yes; then
47 GL_GENERATE_LIMITS_H=false
48 fi])
34]) 49])
35 50
36dnl Unconditionally enables the replacement of <limits.h>. 51dnl Unconditionally enables the replacement of <limits.h>.
diff --git a/gl/m4/localcharset.m4 b/gl/m4/localcharset.m4
index 15b6b2a5..807a5eed 100644
--- a/gl/m4/localcharset.m4
+++ b/gl/m4/localcharset.m4
@@ -1,5 +1,6 @@
1# localcharset.m4 serial 8 1# localcharset.m4
2dnl Copyright (C) 2002, 2004, 2006, 2009-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2002, 2004, 2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/locale-fr.m4 b/gl/m4/locale-fr.m4
index 8c41fadf..f8d7c543 100644
--- a/gl/m4/locale-fr.m4
+++ b/gl/m4/locale-fr.m4
@@ -1,5 +1,6 @@
1# locale-fr.m4 serial 20 1# locale-fr.m4
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. 2# serial 23
3dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
7dnl From Bruno Haible. 8dnl From Bruno Haible.
8 9
9dnl Determine the name of a french locale with traditional encoding. 10dnl Determine the name of a french locale with traditional encoding.
10AC_DEFUN([gt_LOCALE_FR], 11AC_DEFUN_ONCE([gt_LOCALE_FR],
11[ 12[
12 AC_REQUIRE([AC_CANONICAL_HOST]) 13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 14 AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -86,7 +87,7 @@ int main () {
86 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 87 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
87 # "ja" as "Japanese" or "Japanese_Japan.932", 88 # "ja" as "Japanese" or "Japanese_Japan.932",
88 # and similar. 89 # and similar.
89 mingw*) 90 mingw* | windows*)
90 # Test for the native Windows locale name. 91 # Test for the native Windows locale name.
91 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 92 if (LC_ALL=French_France.1252 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
92 gt_cv_locale_fr=French_France.1252 93 gt_cv_locale_fr=French_France.1252
@@ -116,7 +117,7 @@ int main () {
116 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 117 if (LC_ALL=fr_FR.iso88591 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
117 gt_cv_locale_fr=fr_FR.iso88591 118 gt_cv_locale_fr=fr_FR.iso88591
118 else 119 else
119 # Test for the Solaris 7 locale name. 120 # Test for the Solaris 10 locale name.
120 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 121 if (LC_ALL=fr LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
121 gt_cv_locale_fr=fr 122 gt_cv_locale_fr=fr
122 else 123 else
@@ -133,15 +134,31 @@ int main () {
133 rm -fr conftest* 134 rm -fr conftest*
134 ]) 135 ])
135 LOCALE_FR=$gt_cv_locale_fr 136 LOCALE_FR=$gt_cv_locale_fr
137 case $LOCALE_FR in #(
138 '' | *[[[:space:]\"\$\'*@<:@]]*)
139 dnl This locale name might cause trouble with sh or make.
140 AC_MSG_WARN([invalid locale "$LOCALE_FR"; assuming "none"])
141 LOCALE_FR=none;;
142 esac
136 AC_SUBST([LOCALE_FR]) 143 AC_SUBST([LOCALE_FR])
137]) 144])
138 145
139dnl Determine the name of a french locale with UTF-8 encoding. 146dnl Determine the name of a french locale with UTF-8 encoding.
140AC_DEFUN([gt_LOCALE_FR_UTF8], 147AC_DEFUN_ONCE([gt_LOCALE_FR_UTF8],
141[ 148[
149 AC_REQUIRE([AC_CANONICAL_HOST])
142 AC_REQUIRE([AM_LANGINFO_CODESET]) 150 AC_REQUIRE([AM_LANGINFO_CODESET])
143 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [ 151 AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
144 AC_LANG_CONFTEST([AC_LANG_SOURCE([[ 152 case "$host_os" in
153 *-musl* | midipix*)
154 dnl On musl libc, all kinds of ll_CC.UTF-8 locales exist, even without
155 dnl any locale file on disk. But they are effectively equivalent to the
156 dnl C.UTF-8 locale, except for locale categories (such as LC_MESSSAGES)
157 dnl for which localizations (.mo files) have been installed.
158 gt_cv_locale_fr_utf8=fr_FR.UTF-8
159 ;;
160 *)
161 AC_LANG_CONFTEST([AC_LANG_SOURCE([[
145#include <locale.h> 162#include <locale.h>
146#include <time.h> 163#include <time.h>
147#if HAVE_LANGINFO_CODESET 164#if HAVE_LANGINFO_CODESET
@@ -203,51 +220,82 @@ int main () {
203#endif 220#endif
204 return 0; 221 return 0;
205} 222}
206 ]])]) 223 ]])])
207 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then 224 if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
208 case "$host_os" in 225 case "$host_os" in
209 # Handle native Windows specially, because there setlocale() interprets 226 # Handle native Windows specially, because there setlocale() interprets
210 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256", 227 # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
211 # "fr" or "fra" as "French" or "French_France.1252", 228 # "fr" or "fra" as "French" or "French_France.1252",
212 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 229 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
213 # "ja" as "Japanese" or "Japanese_Japan.932", 230 # "ja" as "Japanese" or "Japanese_Japan.932",
214 # and similar. 231 # and similar.
215 mingw*) 232 mingw* | windows*)
216 # Test for the hypothetical native Windows locale name. 233 # Test for the hypothetical native Windows locale name.
217 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 234 if (LC_ALL=French_France.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
218 gt_cv_locale_fr_utf8=French_France.65001 235 gt_cv_locale_fr_utf8=French_France.65001
219 else
220 # None found.
221 gt_cv_locale_fr_utf8=none
222 fi
223 ;;
224 *)
225 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
226 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
227 # configure script would override the LC_ALL setting. Likewise for
228 # LC_CTYPE, which is also set at the beginning of the configure script.
229 # Test for the usual locale name.
230 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
231 gt_cv_locale_fr_utf8=fr_FR
232 else
233 # Test for the locale name with explicit encoding suffix.
234 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
235 gt_cv_locale_fr_utf8=fr_FR.UTF-8
236 else
237 # Test for the Solaris 7 locale name.
238 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
239 gt_cv_locale_fr_utf8=fr.UTF-8
240 else 236 else
241 # None found. 237 # None found.
242 gt_cv_locale_fr_utf8=none 238 gt_cv_locale_fr_utf8=none
243 fi 239 fi
244 fi 240 ;;
245 fi 241 *)
246 ;; 242 # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
247 esac 243 # otherwise on Mac OS X 10.3.5 the LC_TIME=C from the beginning of the
248 fi 244 # configure script would override the LC_ALL setting. Likewise for
249 rm -fr conftest* 245 # LC_CTYPE, which is also set at the beginning of the configure script.
246 # Test for the usual locale name.
247 if (LC_ALL=fr_FR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
248 gt_cv_locale_fr_utf8=fr_FR
249 else
250 # Test for the locale name with explicit encoding suffix.
251 if (LC_ALL=fr_FR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
252 gt_cv_locale_fr_utf8=fr_FR.UTF-8
253 else
254 # Test for the Solaris 10 locale name.
255 if (LC_ALL=fr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
256 gt_cv_locale_fr_utf8=fr.UTF-8
257 else
258 # None found.
259 gt_cv_locale_fr_utf8=none
260 fi
261 fi
262 fi
263 ;;
264 esac
265 fi
266 rm -fr conftest*
267 ;;
268 esac
250 ]) 269 ])
251 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8 270 LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
271 case $LOCALE_FR_UTF8 in #(
272 '' | *[[[:space:]\"\$\'*@<:@]]*)
273 dnl This locale name might cause trouble with sh or make.
274 AC_MSG_WARN([invalid locale "$LOCALE_FR_UTF8"; assuming "none"])
275 LOCALE_FR_UTF8=none;;
276 esac
252 AC_SUBST([LOCALE_FR_UTF8]) 277 AC_SUBST([LOCALE_FR_UTF8])
278
279 dnl Users of $LOCALE_FR_UTF8 need to know which of the locale categories they
280 dnl can rely on.
281 case "$host_os" in
282 *-musl* | midipix*)
283 dnl On musl libc, locale categories other than LC_CTYPE and LC_MESSAGES
284 dnl are effectively unimplemented.
285 LC_COLLATE_IMPLEMENTED=false
286 LC_NUMERIC_IMPLEMENTED=false
287 LC_TIME_IMPLEMENTED=false
288 LC_MONETARY_IMPLEMENTED=false
289 ;;
290 *)
291 LC_COLLATE_IMPLEMENTED=true
292 LC_NUMERIC_IMPLEMENTED=true
293 LC_TIME_IMPLEMENTED=true
294 LC_MONETARY_IMPLEMENTED=true
295 ;;
296 esac
297 AC_SUBST([LC_COLLATE_IMPLEMENTED])
298 AC_SUBST([LC_NUMERIC_IMPLEMENTED])
299 AC_SUBST([LC_TIME_IMPLEMENTED])
300 AC_SUBST([LC_MONETARY_IMPLEMENTED])
253]) 301])
diff --git a/gl/m4/locale-ja.m4 b/gl/m4/locale-ja.m4
index 25901730..8423bcb9 100644
--- a/gl/m4/locale-ja.m4
+++ b/gl/m4/locale-ja.m4
@@ -1,5 +1,6 @@
1# locale-ja.m4 serial 15 1# locale-ja.m4
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. 2# serial 18
3dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
7dnl From Bruno Haible. 8dnl From Bruno Haible.
8 9
9dnl Determine the name of a japanese locale with EUC-JP encoding. 10dnl Determine the name of a japanese locale with EUC-JP encoding.
10AC_DEFUN([gt_LOCALE_JA], 11AC_DEFUN_ONCE([gt_LOCALE_JA],
11[ 12[
12 AC_REQUIRE([AC_CANONICAL_HOST]) 13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 14 AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -90,7 +91,7 @@ int main ()
90 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 91 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
91 # "ja" as "Japanese" or "Japanese_Japan.932", 92 # "ja" as "Japanese" or "Japanese_Japan.932",
92 # and similar. 93 # and similar.
93 mingw*) 94 mingw* | windows*)
94 # Note that on native Windows, the Japanese locale is 95 # Note that on native Windows, the Japanese locale is
95 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we 96 # Japanese_Japan.932, and CP932 is very different from EUC-JP, so we
96 # cannot use it here. 97 # cannot use it here.
@@ -117,7 +118,7 @@ int main ()
117 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 118 if (LC_ALL=ja_JP.EUC LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
118 gt_cv_locale_ja=ja_JP.EUC 119 gt_cv_locale_ja=ja_JP.EUC
119 else 120 else
120 # Test for the Solaris 7 locale name. 121 # Test for the Solaris 10 locale name.
121 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 122 if (LC_ALL=ja LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
122 gt_cv_locale_ja=ja 123 gt_cv_locale_ja=ja
123 else 124 else
@@ -139,5 +140,11 @@ int main ()
139 rm -fr conftest* 140 rm -fr conftest*
140 ]) 141 ])
141 LOCALE_JA=$gt_cv_locale_ja 142 LOCALE_JA=$gt_cv_locale_ja
143 case $LOCALE_JA in #(
144 '' | *[[[:space:]\"\$\'*@<:@]]*)
145 dnl This locale name might cause trouble with sh or make.
146 AC_MSG_WARN([invalid locale "$LOCALE_JA"; assuming "none"])
147 LOCALE_JA=none;;
148 esac
142 AC_SUBST([LOCALE_JA]) 149 AC_SUBST([LOCALE_JA])
143]) 150])
diff --git a/gl/m4/locale-zh.m4 b/gl/m4/locale-zh.m4
index b9f9eef7..7f1a10be 100644
--- a/gl/m4/locale-zh.m4
+++ b/gl/m4/locale-zh.m4
@@ -1,5 +1,6 @@
1# locale-zh.m4 serial 15 1# locale-zh.m4
2dnl Copyright (C) 2003, 2005-2023 Free Software Foundation, Inc. 2# serial 18
3dnl Copyright (C) 2003, 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
7dnl From Bruno Haible. 8dnl From Bruno Haible.
8 9
9dnl Determine the name of a chinese locale with GB18030 encoding. 10dnl Determine the name of a chinese locale with GB18030 encoding.
10AC_DEFUN([gt_LOCALE_ZH_CN], 11AC_DEFUN_ONCE([gt_LOCALE_ZH_CN],
11[ 12[
12 AC_REQUIRE([AC_CANONICAL_HOST]) 13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([AM_LANGINFO_CODESET]) 14 AC_REQUIRE([AM_LANGINFO_CODESET])
@@ -91,7 +92,7 @@ int main ()
91 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252", 92 # "ge"(!) or "deu"(!) as "German" or "German_Germany.1252",
92 # "ja" as "Japanese" or "Japanese_Japan.932", 93 # "ja" as "Japanese" or "Japanese_Japan.932",
93 # and similar. 94 # and similar.
94 mingw*) 95 mingw* | windows*)
95 # Test for the hypothetical native Windows locale name. 96 # Test for the hypothetical native Windows locale name.
96 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then 97 if (LC_ALL=Chinese_China.54936 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
97 gt_cv_locale_zh_CN=Chinese_China.54936 98 gt_cv_locale_zh_CN=Chinese_China.54936
@@ -133,5 +134,11 @@ int main ()
133 rm -fr conftest* 134 rm -fr conftest*
134 ]) 135 ])
135 LOCALE_ZH_CN=$gt_cv_locale_zh_CN 136 LOCALE_ZH_CN=$gt_cv_locale_zh_CN
137 case $LOCALE_ZH_CN in #(
138 '' | *[[[:space:]\"\$\'*@<:@]]*)
139 dnl This locale name might cause trouble with sh or make.
140 AC_MSG_WARN([invalid locale "$LOCALE_ZH_CN"; assuming "none"])
141 LOCALE_ZH_CN=none;;
142 esac
136 AC_SUBST([LOCALE_ZH_CN]) 143 AC_SUBST([LOCALE_ZH_CN])
137]) 144])
diff --git a/gl/m4/locale_h.m4 b/gl/m4/locale_h.m4
index a33a0a46..cd1c81ec 100644
--- a/gl/m4/locale_h.m4
+++ b/gl/m4/locale_h.m4
@@ -1,5 +1,6 @@
1# locale_h.m4 serial 28 1# locale_h.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 31
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -59,7 +60,9 @@ AC_DEFUN_ONCE([gl_LOCALE_H],
59 dnl On native Windows with MSVC, merely define these member names as macros. 60 dnl On native Windows with MSVC, merely define these member names as macros.
60 dnl This avoids trouble in C++ mode. 61 dnl This avoids trouble in C++ mode.
61 case "$host_os" in 62 case "$host_os" in
62 mingw*) 63 windows*-msvc*)
64 ;;
65 mingw* | windows*)
63 AC_EGREP_CPP([Special], [ 66 AC_EGREP_CPP([Special], [
64#ifdef _MSC_VER 67#ifdef _MSC_VER
65 Special 68 Special
@@ -152,7 +155,7 @@ AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
152 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE]) 155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
153 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL]) 156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
154 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE]) 157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME]) 158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME_UNSAFE])
156 ]) 159 ])
157 m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS]) 160 m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
158 AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) 161 AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
diff --git a/gl/m4/localeconv.m4 b/gl/m4/localeconv.m4
index ae225fed..77d5684f 100644
--- a/gl/m4/localeconv.m4
+++ b/gl/m4/localeconv.m4
@@ -1,5 +1,6 @@
1# localeconv.m4 serial 1 1# localeconv.m4
2dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -8,10 +9,45 @@ AC_DEFUN([gl_FUNC_LOCALECONV],
8[ 9[
9 AC_REQUIRE([gl_LOCALE_H_DEFAULTS]) 10 AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
10 AC_REQUIRE([gl_LOCALE_H]) 11 AC_REQUIRE([gl_LOCALE_H])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
11 13
12 if test $REPLACE_STRUCT_LCONV = 1; then 14 if test $REPLACE_STRUCT_LCONV = 1; then
13 REPLACE_LOCALECONV=1 15 REPLACE_LOCALECONV=1
14 fi 16 fi
17 if test $REPLACE_LOCALECONV = 0; then
18 dnl Test whether fields of type 'char' are filled correctly.
19 dnl This test fails on mingw 5.0.3.
20 AC_CACHE_CHECK([whether localeconv works],
21 [gl_cv_func_localeconv_works],
22 [AC_RUN_IFELSE(
23 [AC_LANG_SOURCE([[
24 #include <locale.h>
25 #include <limits.h>
26 int main ()
27 {
28 struct lconv *l = localeconv ();
29 return l->frac_digits != CHAR_MAX && l->frac_digits < 0;
30 }
31 ]])],
32 [gl_cv_func_localeconv_works=yes],
33 [gl_cv_func_localeconv_works=no],
34 [case "$host_os" in
35 # Guess yes on glibc systems.
36 *-gnu* | gnu*) gl_cv_func_localeconv_works="guessing yes" ;;
37 # Guess yes on musl systems.
38 *-musl* | midipix*) gl_cv_func_localeconv_works="guessing yes" ;;
39 # Guess no on native Windows.
40 mingw* | windows*) gl_cv_func_localeconv_works="guessing no" ;;
41 # If we don't know, obey --enable-cross-guesses.
42 *) gl_cv_func_localeconv_works="$gl_cross_guess_normal" ;;
43 esac
44 ])
45 ])
46 case "$gl_cv_func_localeconv_works" in
47 *yes) ;;
48 *) REPLACE_LOCALECONV=1 ;;
49 esac
50 fi
15]) 51])
16 52
17# Prerequisites of lib/localeconv.c. 53# Prerequisites of lib/localeconv.c.
@@ -19,4 +55,6 @@ AC_DEFUN([gl_PREREQ_LOCALECONV],
19[ 55[
20 AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [], 56 AC_CHECK_MEMBERS([struct lconv.decimal_point], [], [],
21 [[#include <locale.h>]]) 57 [[#include <locale.h>]])
58 AC_CHECK_MEMBERS([struct lconv.int_p_cs_precedes], [], [],
59 [[#include <locale.h>]])
22]) 60])
diff --git a/gl/m4/lock.m4 b/gl/m4/lock.m4
index 88cf5575..eb0fc6a1 100644
--- a/gl/m4/lock.m4
+++ b/gl/m4/lock.m4
@@ -1,5 +1,6 @@
1# lock.m4 serial 14 1# lock.m4
2dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/lseek.m4 b/gl/m4/lseek.m4
index fd4f1f27..0bc3d65e 100644
--- a/gl/m4/lseek.m4
+++ b/gl/m4/lseek.m4
@@ -1,5 +1,6 @@
1# lseek.m4 serial 12 1# lseek.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 15
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -13,13 +14,15 @@ AC_DEFUN([gl_FUNC_LSEEK],
13 AC_CHECK_HEADERS_ONCE([unistd.h]) 14 AC_CHECK_HEADERS_ONCE([unistd.h])
14 AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe], 15 AC_CACHE_CHECK([whether lseek detects pipes], [gl_cv_func_lseek_pipe],
15 [case "$host_os" in 16 [case "$host_os" in
16 mingw*) 17 mingw* | windows*)
17 dnl Native Windows. 18 dnl Native Windows.
18 dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or 19 dnl The result of lseek (fd, (off_t)0, SEEK_CUR) or
19 dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT) 20 dnl SetFilePointer(handle, 0, NULL, FILE_CURRENT)
20 dnl for a pipe depends on the environment: In a Cygwin 1.5 21 dnl for a pipe depends on the environment:
21 dnl environment it succeeds (wrong); in a Cygwin 1.7 environment 22 dnl In a Cygwin 1.5 environment it succeeds (wrong);
22 dnl it fails with a wrong errno value. 23 dnl in a Cygwin 1.7 environment it fails with a wrong errno value;
24 dnl in a Cygwin 2.9.0 environment it fails correctly;
25 dnl in a Cygwin 3.4.6 environment it succeeds again (wrong).
23 gl_cv_func_lseek_pipe=no 26 gl_cv_func_lseek_pipe=no
24 ;; 27 ;;
25 *) 28 *)
@@ -70,9 +73,29 @@ AC_DEFUN([gl_FUNC_LSEEK],
70 REPLACE_LSEEK=1 73 REPLACE_LSEEK=1
71 fi 74 fi
72 75
73 dnl macOS SEEK_DATA is incompatible with other platforms. 76 AS_IF([test $REPLACE_LSEEK = 0],
74 case $host_os in 77 [AC_CACHE_CHECK([whether SEEK_DATA works but is incompatible with GNU],
75 darwin*) 78 [gl_cv_func_lseek_works_but_incompatible],
76 REPLACE_LSEEK=1;; 79 [AC_PREPROC_IFELSE(
77 esac 80 [AC_LANG_SOURCE(
81 dnl Use macOS "9999" to stand for a future fixed macOS version.
82 dnl See ../lib/unistd.in.h and <https://bugs.gnu.org/61386>.
83 [[#include <unistd.h>
84 #if defined __APPLE__ && defined __MACH__ && defined SEEK_DATA
85 # ifdef __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
86 # include <AvailabilityMacros.h>
87 # endif
88 # if 99990000 <= MAC_OS_X_VERSION_MIN_REQUIRED
89 # define LSEEK_WORKS_BUT_IS_INCOMPATIBLE_WITH_GNU
90 # endif
91 #endif
92 #ifndef LSEEK_WORKS_BUT_IS_INCOMPATIBLE_WITH_GNU
93 #error "No need to work around the bug"
94 #endif
95 ]])],
96 [gl_cv_func_lseek_works_but_incompatible=yes],
97 [gl_cv_func_lseek_works_but_incompatible=no])])
98 if test "$gl_cv_func_lseek_works_but_incompatible" = yes; then
99 REPLACE_LSEEK=1
100 fi])
78]) 101])
diff --git a/gl/m4/malloc.m4 b/gl/m4/malloc.m4
index 55402924..41a46937 100644
--- a/gl/m4/malloc.m4
+++ b/gl/m4/malloc.m4
@@ -1,5 +1,6 @@
1# malloc.m4 serial 28 1# malloc.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 31
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
16 [[#include <stdlib.h> 17 [[#include <stdlib.h>
17 ]], 18 ]],
18 [[void *p = malloc (0); 19 [[void *p = malloc (0);
19 int result = !p; 20 void * volatile vp = p;
21 int result = !vp;
20 free (p); 22 free (p);
21 return result;]]) 23 return result;]])
22 ], 24 ],
@@ -25,8 +27,8 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
25 [case "$host_os" in 27 [case "$host_os" in
26 # Guess yes on platforms where we know the result. 28 # Guess yes on platforms where we know the result.
27 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ 29 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
28 | gnu* | *-musl* | midnightbsd* \ 30 | gnu* | *-musl* | midipix* | midnightbsd* \
29 | hpux* | solaris* | cygwin* | mingw* | msys* ) 31 | hpux* | solaris* | cygwin* | mingw* | windows* | msys* )
30 ac_cv_func_malloc_0_nonnull="guessing yes" ;; 32 ac_cv_func_malloc_0_nonnull="guessing yes" ;;
31 # If we don't know, obey --enable-cross-guesses. 33 # If we don't know, obey --enable-cross-guesses.
32 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;; 34 *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
@@ -128,7 +130,7 @@ AC_DEFUN([gl_CHECK_MALLOC_POSIX],
128 dnl except on those platforms where we have seen 'test-malloc-gnu', 130 dnl except on those platforms where we have seen 'test-malloc-gnu',
129 dnl 'test-realloc-gnu', 'test-calloc-gnu' fail. 131 dnl 'test-realloc-gnu', 'test-calloc-gnu' fail.
130 case "$host_os" in 132 case "$host_os" in
131 mingw*) 133 mingw* | windows*)
132 gl_cv_func_malloc_posix=no ;; 134 gl_cv_func_malloc_posix=no ;;
133 irix* | solaris*) 135 irix* | solaris*)
134 dnl On IRIX 6.5, the three functions return NULL with errno unset 136 dnl On IRIX 6.5, the three functions return NULL with errno unset
diff --git a/gl/m4/malloca.m4 b/gl/m4/malloca.m4
index 1d777ebe..9e09d22c 100644
--- a/gl/m4/malloca.m4
+++ b/gl/m4/malloca.m4
@@ -1,5 +1,6 @@
1# malloca.m4 serial 2 1# malloca.m4
2dnl Copyright (C) 2003-2004, 2006-2007, 2009-2023 Free Software Foundation, 2# serial 2
3dnl Copyright (C) 2003-2004, 2006-2007, 2009-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/math_h.m4 b/gl/m4/math_h.m4
index d2e90ff1..4b26c9e9 100644
--- a/gl/m4/math_h.m4
+++ b/gl/m4/math_h.m4
@@ -1,5 +1,6 @@
1# math_h.m4 serial 125 1# math_h.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 138
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -42,15 +43,21 @@ AC_DEFUN_ONCE([gl_MATH_H],
42 cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf 43 cbrt cbrtf cbrtl ceilf ceill copysign copysignf copysignl cosf cosl coshf
43 expf expl exp2 exp2f exp2l expm1 expm1f expm1l 44 expf expl exp2 exp2f exp2l expm1 expm1f expm1l
44 fabsf fabsl floorf floorl fma fmaf fmal 45 fabsf fabsl floorf floorl fma fmaf fmal
45 fmod fmodf fmodl frexpf frexpl hypotf hypotl 46 fmod fmodf fmodl frexpf frexpl
47 getpayload getpayloadf getpayloadl
48 hypotf hypotl
46 ilogb ilogbf ilogbl 49 ilogb ilogbf ilogbl
47 ldexpf ldexpl 50 ldexpf ldexpl
48 log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l 51 log logf logl log10 log10f log10l log1p log1pf log1pl log2 log2f log2l
49 logb logbf logbl 52 logb logbf logbl
50 modf modff modfl powf 53 modf modff modfl powf
51 remainder remainderf remainderl 54 remainder remainderf remainderl
52 rint rintf rintl round roundf roundl sinf sinl sinhf sqrtf sqrtl 55 rint rintf rintl round roundf roundl
53 tanf tanl tanhf trunc truncf truncl]) 56 setpayload setpayloadf setpayloadl
57 setpayloadsig setpayloadsigf setpayloadsigl
58 sinf sinl sinhf sqrtf sqrtl
59 tanf tanl tanhf totalorder totalorderf totalorderl totalordermag
60 totalordermagf totalordermagl trunc truncf truncl])
54]) 61])
55 62
56# gl_MATH_MODULE_INDICATOR([modulename]) 63# gl_MATH_MODULE_INDICATOR([modulename])
@@ -113,6 +120,9 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
113 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF]) 120 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
114 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP]) 121 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
115 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL]) 122 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
123 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOAD])
124 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADF])
125 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAYLOADL])
116 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT]) 126 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
117 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF]) 127 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
118 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL]) 128 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
@@ -125,6 +135,7 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
125 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF]) 135 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
126 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND]) 136 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
127 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL]) 137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXP])
128 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF]) 139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
129 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL]) 140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
130 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG]) 141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
@@ -155,6 +166,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
155 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND]) 166 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
156 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF]) 167 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
157 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL]) 168 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
169 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOAD])
170 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADF])
171 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADL])
172 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIG])
173 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGF])
174 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETPAYLOADSIGL])
158 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT]) 175 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
159 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF]) 176 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
160 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL]) 177 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
@@ -164,6 +181,12 @@ AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
164 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF]) 181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
165 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL]) 182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
166 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF]) 183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
184 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDER])
185 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERF])
186 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERL])
187 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAG])
188 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGF])
189 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOTALORDERMAGL])
167 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC]) 190 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
168 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF]) 191 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
169 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL]) 192 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
@@ -209,6 +232,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
209 HAVE_FMODF=1; AC_SUBST([HAVE_FMODF]) 232 HAVE_FMODF=1; AC_SUBST([HAVE_FMODF])
210 HAVE_FMODL=1; AC_SUBST([HAVE_FMODL]) 233 HAVE_FMODL=1; AC_SUBST([HAVE_FMODL])
211 HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF]) 234 HAVE_FREXPF=1; AC_SUBST([HAVE_FREXPF])
235 HAVE_GETPAYLOAD=1; AC_SUBST([HAVE_GETPAYLOAD])
236 HAVE_GETPAYLOADF=1; AC_SUBST([HAVE_GETPAYLOADF])
237 HAVE_GETPAYLOADL=1; AC_SUBST([HAVE_GETPAYLOADL])
212 HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF]) 238 HAVE_HYPOTF=1; AC_SUBST([HAVE_HYPOTF])
213 HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL]) 239 HAVE_HYPOTL=1; AC_SUBST([HAVE_HYPOTL])
214 HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB]) 240 HAVE_ILOGB=1; AC_SUBST([HAVE_ILOGB])
@@ -234,6 +260,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
234 HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF]) 260 HAVE_REMAINDERF=1; AC_SUBST([HAVE_REMAINDERF])
235 HAVE_RINT=1; AC_SUBST([HAVE_RINT]) 261 HAVE_RINT=1; AC_SUBST([HAVE_RINT])
236 HAVE_RINTL=1; AC_SUBST([HAVE_RINTL]) 262 HAVE_RINTL=1; AC_SUBST([HAVE_RINTL])
263 HAVE_SETPAYLOAD=1; AC_SUBST([HAVE_SETPAYLOAD])
264 HAVE_SETPAYLOADF=1; AC_SUBST([HAVE_SETPAYLOADF])
265 HAVE_SETPAYLOADL=1; AC_SUBST([HAVE_SETPAYLOADL])
266 HAVE_SETPAYLOADSIG=1; AC_SUBST([HAVE_SETPAYLOADSIG])
267 HAVE_SETPAYLOADSIGF=1; AC_SUBST([HAVE_SETPAYLOADSIGF])
268 HAVE_SETPAYLOADSIGL=1; AC_SUBST([HAVE_SETPAYLOADSIGL])
237 HAVE_SINF=1; AC_SUBST([HAVE_SINF]) 269 HAVE_SINF=1; AC_SUBST([HAVE_SINF])
238 HAVE_SINL=1; AC_SUBST([HAVE_SINL]) 270 HAVE_SINL=1; AC_SUBST([HAVE_SINL])
239 HAVE_SINHF=1; AC_SUBST([HAVE_SINHF]) 271 HAVE_SINHF=1; AC_SUBST([HAVE_SINHF])
@@ -242,6 +274,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
242 HAVE_TANF=1; AC_SUBST([HAVE_TANF]) 274 HAVE_TANF=1; AC_SUBST([HAVE_TANF])
243 HAVE_TANL=1; AC_SUBST([HAVE_TANL]) 275 HAVE_TANL=1; AC_SUBST([HAVE_TANL])
244 HAVE_TANHF=1; AC_SUBST([HAVE_TANHF]) 276 HAVE_TANHF=1; AC_SUBST([HAVE_TANHF])
277 HAVE_TOTALORDER=1; AC_SUBST([HAVE_TOTALORDER])
278 HAVE_TOTALORDERF=1; AC_SUBST([HAVE_TOTALORDERF])
279 HAVE_TOTALORDERL=1; AC_SUBST([HAVE_TOTALORDERL])
280 HAVE_TOTALORDERMAG=1; AC_SUBST([HAVE_TOTALORDERMAG])
281 HAVE_TOTALORDERMAGF=1; AC_SUBST([HAVE_TOTALORDERMAGF])
282 HAVE_TOTALORDERMAGL=1; AC_SUBST([HAVE_TOTALORDERMAGL])
245 HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL]) 283 HAVE_DECL_ACOSL=1; AC_SUBST([HAVE_DECL_ACOSL])
246 HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL]) 284 HAVE_DECL_ASINL=1; AC_SUBST([HAVE_DECL_ASINL])
247 HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL]) 285 HAVE_DECL_ATANL=1; AC_SUBST([HAVE_DECL_ATANL])
@@ -309,6 +347,9 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
309 REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF]) 347 REPLACE_FREXPF=0; AC_SUBST([REPLACE_FREXPF])
310 REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP]) 348 REPLACE_FREXP=0; AC_SUBST([REPLACE_FREXP])
311 REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL]) 349 REPLACE_FREXPL=0; AC_SUBST([REPLACE_FREXPL])
350 REPLACE_GETPAYLOAD=0; AC_SUBST([REPLACE_GETPAYLOAD])
351 REPLACE_GETPAYLOADF=0; AC_SUBST([REPLACE_GETPAYLOADF])
352 REPLACE_GETPAYLOADL=0; AC_SUBST([REPLACE_GETPAYLOADL])
312 REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL]) 353 REPLACE_HUGE_VAL=0; AC_SUBST([REPLACE_HUGE_VAL])
313 REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT]) 354 REPLACE_HYPOT=0; AC_SUBST([REPLACE_HYPOT])
314 REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF]) 355 REPLACE_HYPOTF=0; AC_SUBST([REPLACE_HYPOTF])
@@ -319,6 +360,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
319 REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE]) 360 REPLACE_ISFINITE=0; AC_SUBST([REPLACE_ISFINITE])
320 REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF]) 361 REPLACE_ISINF=0; AC_SUBST([REPLACE_ISINF])
321 REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN]) 362 REPLACE_ISNAN=0; AC_SUBST([REPLACE_ISNAN])
363 REPLACE_LDEXP=0; AC_SUBST([REPLACE_LDEXP])
322 REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL]) 364 REPLACE_LDEXPL=0; AC_SUBST([REPLACE_LDEXPL])
323 REPLACE_LOG=0; AC_SUBST([REPLACE_LOG]) 365 REPLACE_LOG=0; AC_SUBST([REPLACE_LOG])
324 REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF]) 366 REPLACE_LOGF=0; AC_SUBST([REPLACE_LOGF])
@@ -354,6 +396,12 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
354 REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL]) 396 REPLACE_SQRTL=0; AC_SUBST([REPLACE_SQRTL])
355 REPLACE_TANF=0; AC_SUBST([REPLACE_TANF]) 397 REPLACE_TANF=0; AC_SUBST([REPLACE_TANF])
356 REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF]) 398 REPLACE_TANHF=0; AC_SUBST([REPLACE_TANHF])
399 REPLACE_TOTALORDER=0; AC_SUBST([REPLACE_TOTALORDER])
400 REPLACE_TOTALORDERF=0; AC_SUBST([REPLACE_TOTALORDERF])
401 REPLACE_TOTALORDERL=0; AC_SUBST([REPLACE_TOTALORDERL])
402 REPLACE_TOTALORDERMAG=0; AC_SUBST([REPLACE_TOTALORDERMAG])
403 REPLACE_TOTALORDERMAGF=0; AC_SUBST([REPLACE_TOTALORDERMAGF])
404 REPLACE_TOTALORDERMAGL=0; AC_SUBST([REPLACE_TOTALORDERMAGL])
357 REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC]) 405 REPLACE_TRUNC=0; AC_SUBST([REPLACE_TRUNC])
358 REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF]) 406 REPLACE_TRUNCF=0; AC_SUBST([REPLACE_TRUNCF])
359 REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL]) 407 REPLACE_TRUNCL=0; AC_SUBST([REPLACE_TRUNCL])
@@ -364,7 +412,7 @@ AC_DEFUN([gl_MATH_H_DEFAULTS],
364# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines 412# Sets variable HAVE_SAME_LONG_DOUBLE_AS_DOUBLE to 0 or 1, and defines
365# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly. 413# HAVE_SAME_LONG_DOUBLE_AS_DOUBLE accordingly.
366# The currently known platforms where this is the case are: 414# The currently known platforms where this is the case are:
367# Linux/HPPA, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9. 415# Linux/HPPA, NetBSD/sparc32, Minix 3.1.8, AIX 5, AIX 6 and 7 with xlc, MSVC 9.
368AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE], 416AC_DEFUN([gl_LONG_DOUBLE_VS_DOUBLE],
369[ 417[
370 AC_CACHE_CHECK([whether long double and double are the same], 418 AC_CACHE_CHECK([whether long double and double are the same],
diff --git a/gl/m4/mbrtowc.m4 b/gl/m4/mbrtowc.m4
index bb393041..62c4fdb3 100644
--- a/gl/m4/mbrtowc.m4
+++ b/gl/m4/mbrtowc.m4
@@ -1,5 +1,6 @@
1# mbrtowc.m4 serial 38 -*- coding: utf-8 -*- 1# mbrtowc.m4
2dnl Copyright (C) 2001-2002, 2004-2005, 2008-2023 Free Software Foundation, 2# serial 44 -*- coding: utf-8 -*-
3dnl Copyright (C) 2001-2002, 2004-2005, 2008-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
@@ -91,20 +92,25 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
91 fi 92 fi
92 if test $REPLACE_MBSTATE_T = 1; then 93 if test $REPLACE_MBSTATE_T = 1; then
93 case "$host_os" in 94 case "$host_os" in
94 mingw*) LIB_MBRTOWC= ;; 95 mingw* | windows*)
96 MBRTOWC_LIB=
97 ;;
95 *) 98 *)
96 gl_WEAK_SYMBOLS 99 gl_WEAK_SYMBOLS
97 case "$gl_cv_have_weak" in 100 case "$gl_cv_have_weak" in
98 *yes) LIB_MBRTOWC= ;; 101 *yes) MBRTOWC_LIB= ;;
99 *) LIB_MBRTOWC="$LIBPTHREAD" ;; 102 *) MBRTOWC_LIB="$LIBPTHREAD" ;;
100 esac 103 esac
101 ;; 104 ;;
102 esac 105 esac
103 else 106 else
104 LIB_MBRTOWC= 107 MBRTOWC_LIB=
105 fi 108 fi
106 dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX 109 dnl MBRTOWC_LIB is expected to be '-pthread' or '-lpthread' on AIX
107 dnl with gcc or xlc, and empty otherwise. 110 dnl with gcc or xlc, and empty otherwise.
111 AC_SUBST([MBRTOWC_LIB])
112 dnl For backward compatibility.
113 LIB_MBRTOWC="$MBRTOWC_LIB"
108 AC_SUBST([LIB_MBRTOWC]) 114 AC_SUBST([LIB_MBRTOWC])
109]) 115])
110 116
@@ -114,7 +120,7 @@ dnl Result is REPLACE_MBSTATE_T.
114dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to 120dnl When this is set to 1, we replace both mbsinit() and mbrtowc(), in order to
115dnl avoid inconsistencies. 121dnl avoid inconsistencies.
116 122
117AC_DEFUN([gl_MBSTATE_T_BROKEN], 123AC_DEFUN_ONCE([gl_MBSTATE_T_BROKEN],
118[ 124[
119 AC_REQUIRE([gl_WCHAR_H_DEFAULTS]) 125 AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
120 AC_REQUIRE([AC_CANONICAL_HOST]) 126 AC_REQUIRE([AC_CANONICAL_HOST])
@@ -126,7 +132,7 @@ AC_DEFUN([gl_MBSTATE_T_BROKEN],
126 dnl to override it, even if - like on MSVC - mbsinit() is only defined as 132 dnl to override it, even if - like on MSVC - mbsinit() is only defined as
127 dnl an inline function, not as a global function. 133 dnl an inline function, not as a global function.
128 if case "$host_os" in 134 if case "$host_os" in
129 mingw*) true ;; 135 mingw* | windows*) true ;;
130 *) test $ac_cv_func_mbsinit = yes ;; 136 *) test $ac_cv_func_mbsinit = yes ;;
131 esac \ 137 esac \
132 && test $ac_cv_func_mbrtowc = yes; then 138 && test $ac_cv_func_mbrtowc = yes; then
@@ -408,14 +414,16 @@ AC_DEFUN([gl_MBRTOWC_RETVAL],
408 dnl is present. 414 dnl is present.
409changequote(,)dnl 415changequote(,)dnl
410 case "$host_os" in 416 case "$host_os" in
411 # Guess no on HP-UX, Solaris, native Windows. 417 # Guess no on HP-UX, Solaris, native Windows.
412 hpux* | solaris* | mingw*) gl_cv_func_mbrtowc_retval="guessing no" ;; 418 hpux* | solaris* | mingw* | windows*)
413 # Guess yes otherwise. 419 gl_cv_func_mbrtowc_retval="guessing no" ;;
414 *) gl_cv_func_mbrtowc_retval="guessing yes" ;; 420 # Guess yes otherwise.
421 *)
422 gl_cv_func_mbrtowc_retval="guessing yes" ;;
415 esac 423 esac
416changequote([,])dnl 424changequote([,])dnl
417 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \ 425 if test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none \
418 || { case "$host_os" in mingw*) true;; *) false;; esac; }; then 426 || { case "$host_os" in mingw* | windows*) true;; *) false;; esac; }; then
419 AC_RUN_IFELSE( 427 AC_RUN_IFELSE(
420 [AC_LANG_SOURCE([[ 428 [AC_LANG_SOURCE([[
421#include <locale.h> 429#include <locale.h>
@@ -426,7 +434,8 @@ int main ()
426 int result = 0; 434 int result = 0;
427 int found_some_locale = 0; 435 int found_some_locale = 0;
428 /* This fails on Solaris. */ 436 /* This fails on Solaris. */
429 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 437 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
438 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
430 { 439 {
431 char input[] = "B\303\274\303\237er"; /* "Büßer" */ 440 char input[] = "B\303\274\303\237er"; /* "Büßer" */
432 mbstate_t state; 441 mbstate_t state;
@@ -442,7 +451,8 @@ int main ()
442 found_some_locale = 1; 451 found_some_locale = 1;
443 } 452 }
444 /* This fails on HP-UX 11.11. */ 453 /* This fails on HP-UX 11.11. */
445 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) 454 if (strcmp ("$LOCALE_JA", "none") != 0
455 && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
446 { 456 {
447 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */ 457 char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
448 mbstate_t state; 458 mbstate_t state;
@@ -577,13 +587,13 @@ AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
577 dnl is present. 587 dnl is present.
578changequote(,)dnl 588changequote(,)dnl
579 case "$host_os" in 589 case "$host_os" in
580 # Guess yes on native Windows. 590 # Guess yes on native Windows.
581 mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;; 591 mingw* | windows*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
582 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;; 592 *) gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
583 esac 593 esac
584changequote([,])dnl 594changequote([,])dnl
585 case "$host_os" in 595 case "$host_os" in
586 mingw*) 596 mingw* | windows*)
587 AC_RUN_IFELSE( 597 AC_RUN_IFELSE(
588 [AC_LANG_SOURCE([[ 598 [AC_LANG_SOURCE([[
589#include <locale.h> 599#include <locale.h>
@@ -677,31 +687,28 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
677 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 687 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
678 AC_CACHE_CHECK([whether mbrtowc works on empty input], 688 AC_CACHE_CHECK([whether mbrtowc works on empty input],
679 [gl_cv_func_mbrtowc_empty_input], 689 [gl_cv_func_mbrtowc_empty_input],
680 [ 690 [AC_RUN_IFELSE(
681 dnl Initial guess, used when cross-compiling or when no suitable locale 691 [AC_LANG_SOURCE([[
682 dnl is present. 692 #include <wchar.h>
683changequote(,)dnl 693 static wchar_t wc;
684 case "$host_os" in 694 static mbstate_t mbs;
685 # Guess no on AIX and glibc systems. 695 int
686 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;; 696 main (void)
687 # Guess yes on native Windows. 697 {
688 mingw*) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; 698 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
689 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;; 699 }]])],
690 esac 700 [gl_cv_func_mbrtowc_empty_input=yes],
691changequote([,])dnl 701 [gl_cv_func_mbrtowc_empty_input=no],
692 AC_RUN_IFELSE( 702 [case "$host_os" in
693 [AC_LANG_SOURCE([[ 703 # Guess no on AIX and glibc systems.
694 #include <wchar.h> 704 aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
695 static wchar_t wc; 705 # Guess no on Android.
696 static mbstate_t mbs; 706 linux*-android*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
697 int 707 # Guess no on native Windows.
698 main (void) 708 mingw* | windows*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
699 { 709 *) gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
700 return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2; 710 esac
701 }]])], 711 ])
702 [gl_cv_func_mbrtowc_empty_input=yes],
703 [gl_cv_func_mbrtowc_empty_input=no],
704 [:])
705 ]) 712 ])
706]) 713])
707 714
@@ -709,18 +716,17 @@ dnl Test whether mbrtowc reports encoding errors in the C locale.
709dnl Although POSIX was never intended to allow this, the GNU C Library 716dnl Although POSIX was never intended to allow this, the GNU C Library
710dnl and other implementations do it. See: 717dnl and other implementations do it. See:
711dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932 718dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
719dnl POSIX has now clarified it:
720dnl <https://pubs.opengroup.org/onlinepubs/9699919799/functions/mbrtowc.html>
721dnl says: "In the POSIX locale an [EILSEQ] error cannot occur since all byte
722dnl values are valid characters."
712 723
713AC_DEFUN([gl_MBRTOWC_C_LOCALE], 724AC_DEFUN([gl_MBRTOWC_C_LOCALE],
714[ 725[
715 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 726 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
716 AC_CACHE_CHECK([whether the C locale is free of encoding errors], 727 AC_CACHE_CHECK([whether the C locale is free of encoding errors],
717 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ], 728 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
718 [ 729 [AC_RUN_IFELSE(
719 dnl Initial guess, used when cross-compiling or when no suitable locale
720 dnl is present.
721 gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
722
723 AC_RUN_IFELSE(
724 [AC_LANG_PROGRAM( 730 [AC_LANG_PROGRAM(
725 [[#include <limits.h> 731 [[#include <limits.h>
726 #include <locale.h> 732 #include <locale.h>
@@ -741,13 +747,14 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
741 } 747 }
742 return 0; 748 return 0;
743 ]])], 749 ]])],
744 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes], 750 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
745 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no], 751 [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
746 [case "$host_os" in 752 [case "$host_os" in
747 # Guess yes on native Windows. 753 # Guess yes on native Windows.
748 mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;; 754 mingw* | windows*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
749 esac 755 *) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal" ;;
750 ]) 756 esac
757 ])
751 ]) 758 ])
752]) 759])
753 760
diff --git a/gl/m4/mbsinit.m4 b/gl/m4/mbsinit.m4
index c388a8b9..10c86ba9 100644
--- a/gl/m4/mbsinit.m4
+++ b/gl/m4/mbsinit.m4
@@ -1,5 +1,6 @@
1# mbsinit.m4 serial 9 1# mbsinit.m4
2dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. 2# serial 10
3dnl Copyright (C) 2008, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -32,7 +33,7 @@ AC_DEFUN([gl_FUNC_MBSINIT],
32 dnl states produced by mbrtowc() for an incomplete multibyte character 33 dnl states produced by mbrtowc() for an incomplete multibyte character
33 dnl in multibyte locales. 34 dnl in multibyte locales.
34 case "$host_os" in 35 case "$host_os" in
35 mingw*) REPLACE_MBSINIT=1 ;; 36 mingw* | windows*) REPLACE_MBSINIT=1 ;;
36 esac 37 esac
37 fi 38 fi
38 fi 39 fi
diff --git a/gl/m4/mbstate_t.m4 b/gl/m4/mbstate_t.m4
index dcd66b96..66d65cd7 100644
--- a/gl/m4/mbstate_t.m4
+++ b/gl/m4/mbstate_t.m4
@@ -1,5 +1,6 @@
1# mbstate_t.m4 serial 14 1# mbstate_t.m4
2dnl Copyright (C) 2000-2002, 2008-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2000-2002, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mbtowc.m4 b/gl/m4/mbtowc.m4
index 7823be0e..603b0c1a 100644
--- a/gl/m4/mbtowc.m4
+++ b/gl/m4/mbtowc.m4
@@ -1,5 +1,6 @@
1# mbtowc.m4 serial 3 1# mbtowc.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -8,9 +9,12 @@ AC_DEFUN([gl_FUNC_MBTOWC],
8[ 9[
9 AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) 10 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
10 11
11 AC_CHECK_FUNCS([mbtowc]) 12 gl_CHECK_FUNCS_ANDROID([mbtowc], [[#include <stdlib.h>]])
12 if test $ac_cv_func_mbtowc = no; then 13 if test $ac_cv_func_mbtowc = no; then
13 HAVE_MBTOWC=0 14 HAVE_MBTOWC=0
15 case "$gl_cv_onwards_func_mbtowc" in
16 future*) REPLACE_MBTOWC=1 ;;
17 esac
14 else 18 else
15 if false; then 19 if false; then
16 REPLACE_MBTOWC=1 20 REPLACE_MBTOWC=1
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4
index 4f1aed01..346a2882 100644
--- a/gl/m4/memchr.m4
+++ b/gl/m4/memchr.m4
@@ -1,5 +1,6 @@
1# memchr.m4 serial 18 1# memchr.m4
2dnl Copyright (C) 2002-2004, 2009-2023 Free Software Foundation, Inc. 2# serial 19
3dnl Copyright (C) 2002-2004, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -85,12 +86,12 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
85 [gl_cv_func_memchr_works=yes], 86 [gl_cv_func_memchr_works=yes],
86 [gl_cv_func_memchr_works=no], 87 [gl_cv_func_memchr_works=no],
87 [case "$host_os" in 88 [case "$host_os" in
88 # Guess no on Android. 89 # Guess no on Android.
89 linux*-android*) gl_cv_func_memchr_works="guessing no" ;; 90 linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
90 # Guess yes on native Windows. 91 # Guess yes on native Windows.
91 mingw*) gl_cv_func_memchr_works="guessing yes" ;; 92 mingw* | windows*) gl_cv_func_memchr_works="guessing yes" ;;
92 # If we don't know, obey --enable-cross-guesses. 93 # If we don't know, obey --enable-cross-guesses.
93 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;; 94 *) gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
94 esac 95 esac
95 ]) 96 ])
96 ]) 97 ])
diff --git a/gl/m4/minmax.m4 b/gl/m4/minmax.m4
index fd09846f..bc7d0c34 100644
--- a/gl/m4/minmax.m4
+++ b/gl/m4/minmax.m4
@@ -1,5 +1,6 @@
1# minmax.m4 serial 4 1# minmax.m4
2dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mktime.m4 b/gl/m4/mktime.m4
index e9d31f35..85c52454 100644
--- a/gl/m4/mktime.m4
+++ b/gl/m4/mktime.m4
@@ -1,6 +1,6 @@
1# serial 37 1# mktime.m4
2dnl Copyright (C) 2002-2003, 2005-2007, 2009-2023 Free Software Foundation, 2# serial 39
3dnl Inc. 3dnl Copyright (C) 2002-2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -264,9 +264,9 @@ main ()
264 [gl_cv_func_working_mktime=yes], 264 [gl_cv_func_working_mktime=yes],
265 [gl_cv_func_working_mktime=no], 265 [gl_cv_func_working_mktime=no],
266 [case "$host_os" in 266 [case "$host_os" in
267 # Guess no on native Windows. 267 # Guess no on native Windows.
268 mingw*) gl_cv_func_working_mktime="guessing no" ;; 268 mingw* | windows*) gl_cv_func_working_mktime="guessing no" ;;
269 *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;; 269 *) gl_cv_func_working_mktime="$gl_cross_guess_normal" ;;
270 esac 270 esac
271 ]) 271 ])
272 fi 272 fi
@@ -280,7 +280,6 @@ AC_DEFUN([gl_FUNC_MKTIME],
280 AC_REQUIRE([AC_CANONICAL_HOST]) 280 AC_REQUIRE([AC_CANONICAL_HOST])
281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 281 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
282 282
283 REPLACE_MKTIME=0
284 if test "$gl_cv_func_working_mktime" != yes; then 283 if test "$gl_cv_func_working_mktime" != yes; then
285 REPLACE_MKTIME=1 284 REPLACE_MKTIME=1
286 AC_DEFINE([NEED_MKTIME_WORKING], [1], 285 AC_DEFINE([NEED_MKTIME_WORKING], [1],
@@ -288,7 +287,7 @@ AC_DEFUN([gl_FUNC_MKTIME],
288 with the algorithmic workarounds.]) 287 with the algorithmic workarounds.])
289 fi 288 fi
290 case "$host_os" in 289 case "$host_os" in
291 mingw*) 290 mingw* | windows*)
292 REPLACE_MKTIME=1 291 REPLACE_MKTIME=1
293 AC_DEFINE([NEED_MKTIME_WINDOWS], [1], 292 AC_DEFINE([NEED_MKTIME_WINDOWS], [1],
294 [Define if the compilation of mktime.c should define 'mktime' 293 [Define if the compilation of mktime.c should define 'mktime'
diff --git a/gl/m4/mmap-anon.m4 b/gl/m4/mmap-anon.m4
index d07d26e4..61ca0120 100644
--- a/gl/m4/mmap-anon.m4
+++ b/gl/m4/mmap-anon.m4
@@ -1,5 +1,6 @@
1# mmap-anon.m4 serial 12 1# mmap-anon.m4
2dnl Copyright (C) 2005, 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2005, 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mode_t.m4 b/gl/m4/mode_t.m4
index 82197c02..0d5c2808 100644
--- a/gl/m4/mode_t.m4
+++ b/gl/m4/mode_t.m4
@@ -1,5 +1,6 @@
1# mode_t.m4 serial 2 1# mode_t.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 2
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/mountlist.m4 b/gl/m4/mountlist.m4
index a9b4edb9..ff414e66 100644
--- a/gl/m4/mountlist.m4
+++ b/gl/m4/mountlist.m4
@@ -1,5 +1,6 @@
1# serial 15 1# mountlist.m4
2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. 2# serial 17
3dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -106,7 +107,18 @@ $ac_includes_default
106 [Define if there is a function named getmntent for reading the list 107 [Define if there is a function named getmntent for reading the list
107 of mounted file systems, and that function takes a single argument. 108 of mounted file systems, and that function takes a single argument.
108 (4.3BSD, SunOS, HP-UX, Irix)]) 109 (4.3BSD, SunOS, HP-UX, Irix)])
109 AC_CHECK_FUNCS([setmntent endmntent hasmntopt]) 110 gl_CHECK_FUNCS_ANDROID([setmntent],
111 [[#include <stdio.h>
112 #include <mntent.h>
113 ]])
114 gl_CHECK_FUNCS_ANDROID([endmntent],
115 [[#include <stdio.h>
116 #include <mntent.h>
117 ]])
118 gl_CHECK_FUNCS_ANDROID([hasmntopt],
119 [[#include <stdio.h>
120 #include <mntent.h>
121 ]])
110 fi 122 fi
111 fi 123 fi
112 124
diff --git a/gl/m4/msvc-inval.m4 b/gl/m4/msvc-inval.m4
index 8d9d21b5..7919ff12 100644
--- a/gl/m4/msvc-inval.m4
+++ b/gl/m4/msvc-inval.m4
@@ -1,5 +1,6 @@
1# msvc-inval.m4 serial 1 1# msvc-inval.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/msvc-nothrow.m4 b/gl/m4/msvc-nothrow.m4
index 0263e490..007c7620 100644
--- a/gl/m4/msvc-nothrow.m4
+++ b/gl/m4/msvc-nothrow.m4
@@ -1,5 +1,6 @@
1# msvc-nothrow.m4 serial 1 1# msvc-nothrow.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/multiarch.m4 b/gl/m4/multiarch.m4
index 3ba5b0f7..3af29d39 100644
--- a/gl/m4/multiarch.m4
+++ b/gl/m4/multiarch.m4
@@ -1,5 +1,6 @@
1# multiarch.m4 serial 9 1# multiarch.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/musl.m4 b/gl/m4/musl.m4
new file mode 100644
index 00000000..0d4de892
--- /dev/null
+++ b/gl/m4/musl.m4
@@ -0,0 +1,21 @@
1# musl.m4
2# serial 4
3dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8# Test for musl libc, despite the musl libc authors don't like it
9# <https://wiki.musl-libc.org/faq.html>
10# <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html>.
11# From Bruno Haible.
12
13AC_DEFUN_ONCE([gl_MUSL_LIBC],
14[
15 AC_REQUIRE([AC_CANONICAL_HOST])
16 case "$host_os" in
17 *-musl* | midipix*)
18 AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.])
19 ;;
20 esac
21])
diff --git a/gl/m4/netdb_h.m4 b/gl/m4/netdb_h.m4
index e6aa8925..d8c00217 100644
--- a/gl/m4/netdb_h.m4
+++ b/gl/m4/netdb_h.m4
@@ -1,5 +1,6 @@
1# netdb_h.m4 serial 15 1# netdb_h.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 15
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/netinet_in_h.m4 b/gl/m4/netinet_in_h.m4
index 71154191..926f7f95 100644
--- a/gl/m4/netinet_in_h.m4
+++ b/gl/m4/netinet_in_h.m4
@@ -1,5 +1,6 @@
1# netinet_in_h.m4 serial 6 1# netinet_in_h.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 6
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/nl_langinfo.m4 b/gl/m4/nl_langinfo.m4
index 51e783ce..f38f11bb 100644
--- a/gl/m4/nl_langinfo.m4
+++ b/gl/m4/nl_langinfo.m4
@@ -1,5 +1,6 @@
1# nl_langinfo.m4 serial 8 1# nl_langinfo.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -8,7 +9,7 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
8[ 9[
9 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS]) 10 AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
10 AC_REQUIRE([gl_LANGINFO_H]) 11 AC_REQUIRE([gl_LANGINFO_H])
11 AC_CHECK_FUNCS_ONCE([nl_langinfo]) 12 gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
12 AC_REQUIRE([AC_CANONICAL_HOST]) 13 AC_REQUIRE([AC_CANONICAL_HOST])
13 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL]) 14 AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
14 AC_REQUIRE([gl_PTHREADLIB]) 15 AC_REQUIRE([gl_PTHREADLIB])
@@ -60,9 +61,12 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
60 fi 61 fi
61 else 62 else
62 HAVE_NL_LANGINFO=0 63 HAVE_NL_LANGINFO=0
64 case "$gl_cv_onwards_func_nl_langinfo" in
65 future*) REPLACE_NL_LANGINFO=1 ;;
66 esac
63 fi 67 fi
64 if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then 68 if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
65 LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL" 69 LIB_NL_LANGINFO="$SETLOCALE_NULL_LIB"
66 else 70 else
67 LIB_NL_LANGINFO= 71 LIB_NL_LANGINFO=
68 fi 72 fi
diff --git a/gl/m4/nocrash.m4 b/gl/m4/nocrash.m4
index 6a766387..cbe8fe82 100644
--- a/gl/m4/nocrash.m4
+++ b/gl/m4/nocrash.m4
@@ -1,5 +1,6 @@
1# nocrash.m4 serial 5 1# nocrash.m4
2dnl Copyright (C) 2005, 2009-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2005, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/off_t.m4 b/gl/m4/off_t.m4
index 880f3472..db6035db 100644
--- a/gl/m4/off_t.m4
+++ b/gl/m4/off_t.m4
@@ -1,5 +1,6 @@
1# off_t.m4 serial 1 1# off_t.m4
2dnl Copyright (C) 2012-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2012-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/open-cloexec.m4 b/gl/m4/open-cloexec.m4
index fd572fcd..6defdfb4 100644
--- a/gl/m4/open-cloexec.m4
+++ b/gl/m4/open-cloexec.m4
@@ -1,10 +1,12 @@
1# Test whether O_CLOEXEC is defined. 1# open-cloexec.m4
2 2# serial 1
3dnl Copyright 2017-2023 Free Software Foundation, Inc. 3dnl Copyright 2017-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# Test whether O_CLOEXEC is defined.
9
8AC_DEFUN([gl_PREPROC_O_CLOEXEC], 10AC_DEFUN([gl_PREPROC_O_CLOEXEC],
9[ 11[
10 AC_CACHE_CHECK([for O_CLOEXEC], 12 AC_CACHE_CHECK([for O_CLOEXEC],
diff --git a/gl/m4/open-slash.m4 b/gl/m4/open-slash.m4
index 1f731f8a..03460e42 100644
--- a/gl/m4/open-slash.m4
+++ b/gl/m4/open-slash.m4
@@ -1,5 +1,6 @@
1# open-slash.m4 serial 2 1# open-slash.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 2
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/open.m4 b/gl/m4/open.m4
index 94fa2bb7..62a11a11 100644
--- a/gl/m4/open.m4
+++ b/gl/m4/open.m4
@@ -1,5 +1,6 @@
1# open.m4 serial 15 1# open.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +10,7 @@ AC_DEFUN([gl_FUNC_OPEN],
9 AC_REQUIRE([AC_CANONICAL_HOST]) 10 AC_REQUIRE([AC_CANONICAL_HOST])
10 AC_REQUIRE([gl_PREPROC_O_CLOEXEC]) 11 AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
11 case "$host_os" in 12 case "$host_os" in
12 mingw* | pw*) 13 mingw* | windows* | pw*)
13 REPLACE_OPEN=1 14 REPLACE_OPEN=1
14 ;; 15 ;;
15 *) 16 *)
diff --git a/gl/m4/pathmax.m4 b/gl/m4/pathmax.m4
index 6d47d2c0..4280837f 100644
--- a/gl/m4/pathmax.m4
+++ b/gl/m4/pathmax.m4
@@ -1,5 +1,6 @@
1# pathmax.m4 serial 11 1# pathmax.m4
2dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, 2# serial 11
3dnl Copyright (C) 2002-2003, 2005-2006, 2009-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/pid_t.m4 b/gl/m4/pid_t.m4
index 0fd7d0a1..8bedcc6b 100644
--- a/gl/m4/pid_t.m4
+++ b/gl/m4/pid_t.m4
@@ -1,5 +1,6 @@
1# pid_t.m4 serial 4 1# pid_t.m4
2dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4
index 4e65abc6..0cb14d6f 100644
--- a/gl/m4/printf.m4
+++ b/gl/m4/printf.m4
@@ -1,5 +1,6 @@
1# printf.m4 serial 73 1# printf.m4
2dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. 2# serial 91
3dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -63,7 +64,7 @@ changequote(,)dnl
63 # Guess yes on glibc systems. 64 # Guess yes on glibc systems.
64 *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";; 65 *-gnu* | gnu*) gl_cv_func_printf_sizes_c99="guessing yes";;
65 # Guess yes on musl systems. 66 # Guess yes on musl systems.
66 *-musl*) gl_cv_func_printf_sizes_c99="guessing yes";; 67 *-musl* | midipix*) gl_cv_func_printf_sizes_c99="guessing yes";;
67 # Guess yes on FreeBSD >= 5. 68 # Guess yes on FreeBSD >= 5.
68 freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";; 69 freebsd[1-4].*) gl_cv_func_printf_sizes_c99="guessing no";;
69 freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";; 70 freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
@@ -86,7 +87,8 @@ changequote(,)dnl
86 linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";; 87 linux*-android*) gl_cv_func_printf_sizes_c99="guessing yes";;
87changequote([,])dnl 88changequote([,])dnl
88 # Guess yes on MSVC, no on mingw. 89 # Guess yes on MSVC, no on mingw.
89 mingw*) AC_EGREP_CPP([Known], [ 90 windows*-msvc*) gl_cv_func_printf_sizes_c99="guessing yes" ;;
91 mingw* | windows*) AC_EGREP_CPP([Known], [
90#ifdef _MSC_VER 92#ifdef _MSC_VER
91 Known 93 Known
92#endif 94#endif
@@ -101,6 +103,92 @@ changequote([,])dnl
101 ]) 103 ])
102]) 104])
103 105
106dnl Test whether the *printf family of functions supports the 'w8', 'w16',
107dnl 'w32', 'w64', 'wf8', 'wf16', 'wf32', 'wf64' size specifiers. (ISO C23)
108dnl Result is gl_cv_func_printf_sizes_c23.
109
110AC_DEFUN([gl_PRINTF_SIZES_C23],
111[
112 AC_REQUIRE([AC_PROG_CC])
113 AC_REQUIRE([gl_AC_HEADER_STDINT_H])
114 AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
115 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
116 AC_CACHE_CHECK([whether printf supports size specifiers as in C23],
117 [gl_cv_func_printf_sizes_c23],
118 [
119 AC_RUN_IFELSE(
120 [AC_LANG_SOURCE([[
121#include <stddef.h>
122#include <stdio.h>
123#include <string.h>
124#include <sys/types.h>
125#if HAVE_STDINT_H_WITH_UINTMAX
126# include <stdint.h>
127#endif
128#if HAVE_INTTYPES_H_WITH_UINTMAX
129# include <inttypes.h>
130#endif
131static char buf[100];
132int main ()
133{
134 int result = 0;
135 buf[0] = '\0';
136 if (sprintf (buf, "%w8u %d", (uint8_t) 123, 33, 44, 55) < 0
137 || strcmp (buf, "123 33") != 0)
138 result |= 1;
139 buf[0] = '\0';
140 if (sprintf (buf, "%wf8u %d", (uint_fast8_t) 123, 33, 44, 55) < 0
141 || strcmp (buf, "123 33") != 0)
142 result |= 1;
143 buf[0] = '\0';
144 if (sprintf (buf, "%w16u %d", (uint16_t) 12345, 33, 44, 55) < 0
145 || strcmp (buf, "12345 33") != 0)
146 result |= 2;
147 buf[0] = '\0';
148 if (sprintf (buf, "%wf16u %d", (uint_fast16_t) 12345, 33, 44, 55) < 0
149 || strcmp (buf, "12345 33") != 0)
150 result |= 2;
151 buf[0] = '\0';
152 if (sprintf (buf, "%w32u %d", (uint32_t) 12345671, 33, 44, 55) < 0
153 || strcmp (buf, "12345671 33") != 0)
154 result |= 4;
155 buf[0] = '\0';
156 if (sprintf (buf, "%wf32u %d", (uint_fast32_t) 12345671, 33, 44, 55) < 0
157 || strcmp (buf, "12345671 33") != 0)
158 result |= 4;
159#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
160 buf[0] = '\0';
161 if (sprintf (buf, "%w64u %d", (uint64_t) 12345671, 33, 44, 55) < 0
162 || strcmp (buf, "12345671 33") != 0)
163 result |= 8;
164 buf[0] = '\0';
165 if (sprintf (buf, "%wf64u %d", (uint_fast64_t) 12345671, 33, 44, 55) < 0
166 || strcmp (buf, "12345671 33") != 0)
167 result |= 8;
168#else
169 result |= 8;
170#endif
171 return result;
172}]])],
173 [gl_cv_func_printf_sizes_c23=yes],
174 [gl_cv_func_printf_sizes_c23=no],
175 [
176 case "$host_os" in
177 # Guess no on glibc systems.
178 *-gnu* | gnu*) gl_cv_func_printf_sizes_c23="guessing no";;
179 # Guess no on musl systems.
180 *-musl* | midipix*) gl_cv_func_printf_sizes_c23="guessing no";;
181 # Guess no on Android.
182 linux*-android*) gl_cv_func_printf_sizes_c23="guessing no";;
183 # Guess no on native Windows.
184 mingw* | windows*) gl_cv_func_printf_sizes_c23="guessing no";;
185 # If we don't know, obey --enable-cross-guesses.
186 *) gl_cv_func_printf_sizes_c23="$gl_cross_guess_normal";;
187 esac
188 ])
189 ])
190])
191
104dnl Test whether the *printf family of functions supports 'long double' 192dnl Test whether the *printf family of functions supports 'long double'
105dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001) 193dnl arguments together with the 'L' size specifier. (ISO C99, POSIX:2001)
106dnl Result is gl_cv_func_printf_long_double. 194dnl Result is gl_cv_func_printf_long_double.
@@ -137,20 +225,21 @@ int main ()
137 [gl_cv_func_printf_long_double=yes], 225 [gl_cv_func_printf_long_double=yes],
138 [gl_cv_func_printf_long_double=no], 226 [gl_cv_func_printf_long_double=no],
139 [case "$host_os" in 227 [case "$host_os" in
140 # Guess no on BeOS. 228 # Guess no on BeOS.
141 beos*) gl_cv_func_printf_long_double="guessing no";; 229 beos*) gl_cv_func_printf_long_double="guessing no";;
142 # Guess yes on Android. 230 # Guess yes on Android.
143 linux*-android*) gl_cv_func_printf_long_double="guessing yes";; 231 linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
144 # Guess yes on MSVC, no on mingw. 232 # Guess yes on MSVC, no on mingw.
145 mingw*) AC_EGREP_CPP([Known], [ 233 windows*-msvc*) gl_cv_func_printf_long_double="guessing yes" ;;
234 mingw* | windows*) AC_EGREP_CPP([Known], [
146#ifdef _MSC_VER 235#ifdef _MSC_VER
147 Known 236 Known
148#endif 237#endif
149 ], 238 ],
150 [gl_cv_func_printf_long_double="guessing yes"], 239 [gl_cv_func_printf_long_double="guessing yes"],
151 [gl_cv_func_printf_long_double="guessing no"]) 240 [gl_cv_func_printf_long_double="guessing no"])
152 ;; 241 ;;
153 *) gl_cv_func_printf_long_double="guessing yes";; 242 *) gl_cv_func_printf_long_double="guessing yes";;
154 esac 243 esac
155 ]) 244 ])
156 ]) 245 ])
@@ -244,7 +333,7 @@ changequote(,)dnl
244 # Guess yes on glibc systems. 333 # Guess yes on glibc systems.
245 *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";; 334 *-gnu* | gnu*) gl_cv_func_printf_infinite="guessing yes";;
246 # Guess yes on musl systems. 335 # Guess yes on musl systems.
247 *-musl*) gl_cv_func_printf_infinite="guessing yes";; 336 *-musl* | midipix*) gl_cv_func_printf_infinite="guessing yes";;
248 # Guess yes on FreeBSD >= 6. 337 # Guess yes on FreeBSD >= 6.
249 freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";; 338 freebsd[1-5].*) gl_cv_func_printf_infinite="guessing no";;
250 freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";; 339 freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
@@ -268,7 +357,8 @@ changequote(,)dnl
268 linux*-android*) gl_cv_func_printf_infinite="guessing no";; 357 linux*-android*) gl_cv_func_printf_infinite="guessing no";;
269changequote([,])dnl 358changequote([,])dnl
270 # Guess yes on MSVC, no on mingw. 359 # Guess yes on MSVC, no on mingw.
271 mingw*) AC_EGREP_CPP([Known], [ 360 windows*-msvc*) gl_cv_func_printf_infinite="guessing yes" ;;
361 mingw* | windows*) AC_EGREP_CPP([Known], [
272#ifdef _MSC_VER 362#ifdef _MSC_VER
273 Known 363 Known
274#endif 364#endif
@@ -467,7 +557,7 @@ changequote(,)dnl
467 # Guess yes on glibc systems. 557 # Guess yes on glibc systems.
468 *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";; 558 *-gnu* | gnu*) gl_cv_func_printf_infinite_long_double="guessing yes";;
469 # Guess yes on musl systems. 559 # Guess yes on musl systems.
470 *-musl*) gl_cv_func_printf_infinite_long_double="guessing yes";; 560 *-musl* | midipix*) gl_cv_func_printf_infinite_long_double="guessing yes";;
471 # Guess yes on FreeBSD >= 6. 561 # Guess yes on FreeBSD >= 6.
472 freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";; 562 freebsd[1-5].*) gl_cv_func_printf_infinite_long_double="guessing no";;
473 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";; 563 freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
@@ -482,7 +572,8 @@ changequote(,)dnl
482 linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";; 572 linux*-android*) gl_cv_func_printf_infinite_long_double="guessing no";;
483changequote([,])dnl 573changequote([,])dnl
484 # Guess yes on MSVC, no on mingw. 574 # Guess yes on MSVC, no on mingw.
485 mingw*) AC_EGREP_CPP([Known], [ 575 windows*-msvc*) gl_cv_func_printf_infinite_long_double="guessing yes" ;;
576 mingw* | windows*) AC_EGREP_CPP([Known], [
486#ifdef _MSC_VER 577#ifdef _MSC_VER
487 Known 578 Known
488#endif 579#endif
@@ -591,11 +682,11 @@ int main ()
591 [gl_cv_func_printf_directive_a="guessing no"]) 682 [gl_cv_func_printf_directive_a="guessing no"])
592 ;; 683 ;;
593 # Guess yes on musl systems. 684 # Guess yes on musl systems.
594 *-musl*) gl_cv_func_printf_directive_a="guessing yes";; 685 *-musl* | midipix*) gl_cv_func_printf_directive_a="guessing yes";;
595 # Guess no on Android. 686 # Guess no on Android.
596 linux*-android*) gl_cv_func_printf_directive_a="guessing no";; 687 linux*-android*) gl_cv_func_printf_directive_a="guessing no";;
597 # Guess no on native Windows. 688 # Guess no on native Windows.
598 mingw*) gl_cv_func_printf_directive_a="guessing no";; 689 mingw* | windows*) gl_cv_func_printf_directive_a="guessing no";;
599 # If we don't know, obey --enable-cross-guesses. 690 # If we don't know, obey --enable-cross-guesses.
600 *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";; 691 *) gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
601 esac 692 esac
@@ -603,6 +694,116 @@ int main ()
603 ]) 694 ])
604]) 695])
605 696
697dnl Test whether the *printf family of functions supports the 'b' conversion
698dnl specifier for binary output of integers.
699dnl (ISO C23)
700dnl Result is gl_cv_func_printf_directive_b.
701
702AC_DEFUN([gl_PRINTF_DIRECTIVE_B],
703[
704 AC_REQUIRE([AC_PROG_CC])
705 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
706 AC_CACHE_CHECK([whether printf supports the 'b' directive],
707 [gl_cv_func_printf_directive_b],
708 [
709 AC_RUN_IFELSE(
710 [AC_LANG_SOURCE([[
711#include <stdio.h>
712#include <string.h>
713static char buf[100];
714int main ()
715{
716 int result = 0;
717 if (sprintf (buf, "%b %d", 12345, 33, 44, 55) < 0
718 || strcmp (buf, "11000000111001 33") != 0)
719 result |= 1;
720 return result;
721}]])],
722 [gl_cv_func_printf_directive_b=yes],
723 [gl_cv_func_printf_directive_b=no],
724 [
725 case "$host_os" in
726 # Guess yes on glibc >= 2.35 systems.
727 *-gnu* | gnu*)
728 AC_EGREP_CPP([Lucky], [
729 #include <features.h>
730 #ifdef __GNU_LIBRARY__
731 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
732 Lucky user
733 #endif
734 #endif
735 ],
736 [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
737 [gl_cv_func_printf_directive_uppercase_b="guessing no"])
738 ;;
739 # Guess no on musl systems.
740 *-musl* | midipix*) gl_cv_func_printf_directive_b="guessing no";;
741 # Guess no on Android.
742 linux*-android*) gl_cv_func_printf_directive_b="guessing no";;
743 # Guess no on native Windows.
744 mingw* | windows*) gl_cv_func_printf_directive_b="guessing no";;
745 # If we don't know, obey --enable-cross-guesses.
746 *) gl_cv_func_printf_directive_b="$gl_cross_guess_normal";;
747 esac
748 ])
749 ])
750])
751
752dnl Test whether the *printf family of functions supports the 'B' conversion
753dnl specifier for binary output of integers.
754dnl (GNU, encouraged by ISO C23 § 7.23.6.1)
755dnl Result is gl_cv_func_printf_directive_uppercase_b.
756
757AC_DEFUN([gl_PRINTF_DIRECTIVE_UPPERCASE_B],
758[
759 AC_REQUIRE([AC_PROG_CC])
760 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
761 AC_CACHE_CHECK([whether printf supports the 'B' directive],
762 [gl_cv_func_printf_directive_uppercase_b],
763 [
764 AC_RUN_IFELSE(
765 [AC_LANG_SOURCE([[
766#include <stdio.h>
767#include <string.h>
768static char buf[100];
769int main ()
770{
771 int result = 0;
772 if (sprintf (buf, "%#B %d", 12345, 33, 44, 55) < 0
773 || strcmp (buf, "0B11000000111001 33") != 0)
774 result |= 1;
775 return result;
776}]])],
777 [gl_cv_func_printf_directive_uppercase_b=yes],
778 [gl_cv_func_printf_directive_uppercase_b=no],
779 [
780 case "$host_os" in
781 # Guess yes on glibc >= 2.35 systems.
782 *-gnu* | gnu*)
783 AC_EGREP_CPP([Lucky], [
784 #include <features.h>
785 #ifdef __GNU_LIBRARY__
786 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 35) || (__GLIBC__ > 2)
787 Lucky user
788 #endif
789 #endif
790 ],
791 [gl_cv_func_printf_directive_uppercase_b="guessing yes"],
792 [gl_cv_func_printf_directive_uppercase_b="guessing no"])
793 ;;
794 # Guess no on musl systems.
795 *-musl* | midipix*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
796 # Guess no on Android.
797 linux*-android*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
798 # Guess no on native Windows.
799 mingw* | windows*) gl_cv_func_printf_directive_uppercase_b="guessing no";;
800 # If we don't know, obey --enable-cross-guesses.
801 *) gl_cv_func_printf_directive_uppercase_b="$gl_cross_guess_normal";;
802 esac
803 ])
804 ])
805])
806
606dnl Test whether the *printf family of functions supports the %F format 807dnl Test whether the *printf family of functions supports the %F format
607dnl directive. (ISO C99, POSIX:2001) 808dnl directive. (ISO C99, POSIX:2001)
608dnl Result is gl_cv_func_printf_directive_f. 809dnl Result is gl_cv_func_printf_directive_f.
@@ -643,7 +844,7 @@ changequote(,)dnl
643 # Guess yes on glibc systems. 844 # Guess yes on glibc systems.
644 *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";; 845 *-gnu* | gnu*) gl_cv_func_printf_directive_f="guessing yes";;
645 # Guess yes on musl systems. 846 # Guess yes on musl systems.
646 *-musl*) gl_cv_func_printf_directive_f="guessing yes";; 847 *-musl* | midipix*) gl_cv_func_printf_directive_f="guessing yes";;
647 # Guess yes on FreeBSD >= 6. 848 # Guess yes on FreeBSD >= 6.
648 freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";; 849 freebsd[1-5].*) gl_cv_func_printf_directive_f="guessing no";;
649 freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";; 850 freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
@@ -661,7 +862,8 @@ changequote(,)dnl
661 linux*-android*) gl_cv_func_printf_directive_f="guessing no";; 862 linux*-android*) gl_cv_func_printf_directive_f="guessing no";;
662changequote([,])dnl 863changequote([,])dnl
663 # Guess yes on MSVC, no on mingw. 864 # Guess yes on MSVC, no on mingw.
664 mingw*) AC_EGREP_CPP([Known], [ 865 windows*-msvc*) gl_cv_func_printf_directive_f="guessing yes" ;;
866 mingw* | windows*) AC_EGREP_CPP([Known], [
665#ifdef _MSC_VER 867#ifdef _MSC_VER
666 Known 868 Known
667#endif 869#endif
@@ -689,6 +891,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
689 [ 891 [
690 AC_RUN_IFELSE( 892 AC_RUN_IFELSE(
691 [AC_LANG_SOURCE([[ 893 [AC_LANG_SOURCE([[
894#include <signal.h>
692#include <stdio.h> 895#include <stdio.h>
693#include <stdlib.h> 896#include <stdlib.h>
694#include <string.h> 897#include <string.h>
@@ -706,6 +909,12 @@ invalid_parameter_handler (const wchar_t *expression,
706 exit (1); 909 exit (1);
707} 910}
708#endif 911#endif
912static void
913abort_handler (int sig)
914{
915 (void) sig;
916 _exit (1);
917}
709static char fmtstring[10]; 918static char fmtstring[10];
710static char buf[100]; 919static char buf[100];
711int main () 920int main ()
@@ -714,6 +923,7 @@ int main ()
714#ifdef _MSC_VER 923#ifdef _MSC_VER
715 _set_invalid_parameter_handler (invalid_parameter_handler); 924 _set_invalid_parameter_handler (invalid_parameter_handler);
716#endif 925#endif
926 signal (SIGABRT, abort_handler);
717 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) 927 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
718 support %n in format strings in read-only memory but not in writable 928 support %n in format strings in read-only memory but not in writable
719 memory. */ 929 memory. */
@@ -727,21 +937,21 @@ int main ()
727 [gl_cv_func_printf_directive_n=yes], 937 [gl_cv_func_printf_directive_n=yes],
728 [gl_cv_func_printf_directive_n=no], 938 [gl_cv_func_printf_directive_n=no],
729 [case "$host_os" in 939 [case "$host_os" in
730 # Guess no on glibc when _FORTIFY_SOURCE >= 2. 940 # Guess no on glibc when _FORTIFY_SOURCE >= 2.
731 *-gnu* | gnu*) AC_COMPILE_IFELSE( 941 *-gnu* | gnu*) AC_COMPILE_IFELSE(
732 [AC_LANG_SOURCE( 942 [AC_LANG_SOURCE(
733 [[#if _FORTIFY_SOURCE >= 2 943 [[#if _FORTIFY_SOURCE >= 2
734 error fail 944 error fail
735 #endif 945 #endif
736 ]])], 946 ]])],
737 [gl_cv_func_printf_directive_n="guessing yes"], 947 [gl_cv_func_printf_directive_n="guessing yes"],
738 [gl_cv_func_printf_directive_n="guessing no"]) 948 [gl_cv_func_printf_directive_n="guessing no"])
739 ;; 949 ;;
740 # Guess no on Android. 950 # Guess no on Android.
741 linux*-android*) gl_cv_func_printf_directive_n="guessing no";; 951 linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
742 # Guess no on native Windows. 952 # Guess no on native Windows.
743 mingw*) gl_cv_func_printf_directive_n="guessing no";; 953 mingw* | windows*) gl_cv_func_printf_directive_n="guessing no";;
744 *) gl_cv_func_printf_directive_n="guessing yes";; 954 *) gl_cv_func_printf_directive_n="guessing yes";;
745 esac 955 esac
746 ]) 956 ])
747 ]) 957 ])
@@ -811,18 +1021,64 @@ int main ()
811 [ 1021 [
812changequote(,)dnl 1022changequote(,)dnl
813 case "$host_os" in 1023 case "$host_os" in
814 # Guess yes on OpenBSD >= 6.0. 1024 # Guess yes on OpenBSD >= 6.0.
815 openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";; 1025 openbsd[1-5].*) gl_cv_func_printf_directive_ls="guessing no";;
816 openbsd*) gl_cv_func_printf_directive_ls="guessing yes";; 1026 openbsd*) gl_cv_func_printf_directive_ls="guessing yes";;
817 irix*) gl_cv_func_printf_directive_ls="guessing no";; 1027 irix*) gl_cv_func_printf_directive_ls="guessing no";;
818 solaris*) gl_cv_func_printf_directive_ls="guessing no";; 1028 solaris*) gl_cv_func_printf_directive_ls="guessing no";;
819 cygwin*) gl_cv_func_printf_directive_ls="guessing no";; 1029 cygwin*) gl_cv_func_printf_directive_ls="guessing no";;
820 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";; 1030 beos* | haiku*) gl_cv_func_printf_directive_ls="guessing no";;
821 # Guess no on Android. 1031 # Guess no on Android.
822 linux*-android*) gl_cv_func_printf_directive_ls="guessing no";; 1032 linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
823 # Guess yes on native Windows. 1033 # Guess yes on native Windows.
824 mingw*) gl_cv_func_printf_directive_ls="guessing yes";; 1034 mingw* | windows*) gl_cv_func_printf_directive_ls="guessing yes";;
825 *) gl_cv_func_printf_directive_ls="guessing yes";; 1035 *) gl_cv_func_printf_directive_ls="guessing yes";;
1036 esac
1037changequote([,])dnl
1038 ])
1039 ])
1040])
1041
1042dnl Test whether the *printf family of functions supports the %lc format
1043dnl directive and in particular, when the argument is a null wide character,
1044dnl whether the functions produce a NUL byte, as specified in ISO C 23
1045dnl after the issue GB-141 was fixed.
1046dnl Result is gl_cv_func_printf_directive_lc.
1047
1048AC_DEFUN([gl_PRINTF_DIRECTIVE_LC],
1049[
1050 AC_REQUIRE([AC_PROG_CC])
1051 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1052 AC_CACHE_CHECK([whether printf supports the 'lc' directive correctly],
1053 [gl_cv_func_printf_directive_lc],
1054 [
1055 AC_RUN_IFELSE(
1056 [AC_LANG_SOURCE([[
1057#include <stdio.h>
1058#include <wchar.h>
1059#include <string.h>
1060int main ()
1061{
1062 int result = 0;
1063 char buf[100];
1064 /* This test fails on musl libc 1.2.4. */
1065 {
1066 buf[0] = '\0';
1067 if (sprintf (buf, "%lc%lc%lc", (wint_t) 'a', (wint_t) 0, (wint_t) 'z') < 0
1068 || memcmp (buf, "a\0z", 4) != 0)
1069 result |= 1;
1070 }
1071 return result;
1072}]])],
1073 [gl_cv_func_printf_directive_lc=yes],
1074 [gl_cv_func_printf_directive_lc=no],
1075 [
1076changequote(,)dnl
1077 case "$host_os" in
1078 # Guess no on musl libc.
1079 *-musl* | midipix*) gl_cv_func_printf_directive_lc="guessing no";;
1080 # Guess yes otherwise.
1081 *) gl_cv_func_printf_directive_lc="guessing yes";;
826 esac 1082 esac
827changequote([,])dnl 1083changequote([,])dnl
828 ]) 1084 ])
@@ -833,7 +1089,7 @@ dnl Test whether the *printf family of functions supports POSIX/XSI format
833dnl strings with positions. (POSIX:2001) 1089dnl strings with positions. (POSIX:2001)
834dnl Result is gl_cv_func_printf_positions. 1090dnl Result is gl_cv_func_printf_positions.
835 1091
836AC_DEFUN([gl_PRINTF_POSITIONS], 1092AC_DEFUN_ONCE([gl_PRINTF_POSITIONS],
837[ 1093[
838 AC_REQUIRE([AC_PROG_CC]) 1094 AC_REQUIRE([AC_PROG_CC])
839 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 1095 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -859,13 +1115,17 @@ int main ()
859changequote(,)dnl 1115changequote(,)dnl
860 case "$host_os" in 1116 case "$host_os" in
861 netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*) 1117 netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
862 gl_cv_func_printf_positions="guessing no";; 1118 gl_cv_func_printf_positions="guessing no";;
863 beos*) gl_cv_func_printf_positions="guessing no";; 1119 beos*)
864 # Guess yes on Android. 1120 gl_cv_func_printf_positions="guessing no";;
865 linux*-android*) gl_cv_func_printf_positions="guessing yes";; 1121 # Guess yes on Android.
866 # Guess no on native Windows. 1122 linux*-android*)
867 mingw* | pw*) gl_cv_func_printf_positions="guessing no";; 1123 gl_cv_func_printf_positions="guessing yes";;
868 *) gl_cv_func_printf_positions="guessing yes";; 1124 # Guess no on native Windows.
1125 mingw* | windows* | pw*)
1126 gl_cv_func_printf_positions="guessing no";;
1127 *)
1128 gl_cv_func_printf_positions="guessing yes";;
869 esac 1129 esac
870changequote([,])dnl 1130changequote([,])dnl
871 ]) 1131 ])
@@ -900,13 +1160,13 @@ int main ()
900 [ 1160 [
901changequote(,)dnl 1161changequote(,)dnl
902 case "$host_os" in 1162 case "$host_os" in
903 cygwin*) gl_cv_func_printf_flag_grouping="guessing no";; 1163 cygwin*) gl_cv_func_printf_flag_grouping="guessing no";;
904 netbsd*) gl_cv_func_printf_flag_grouping="guessing no";; 1164 netbsd*) gl_cv_func_printf_flag_grouping="guessing no";;
905 # Guess no on Android. 1165 # Guess no on Android.
906 linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";; 1166 linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
907 # Guess no on native Windows. 1167 # Guess no on native Windows.
908 mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";; 1168 mingw* | windows* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
909 *) gl_cv_func_printf_flag_grouping="guessing yes";; 1169 *) gl_cv_func_printf_flag_grouping="guessing yes";;
910 esac 1170 esac
911changequote([,])dnl 1171changequote([,])dnl
912 ]) 1172 ])
@@ -943,16 +1203,16 @@ int main ()
943 [ 1203 [
944changequote(,)dnl 1204changequote(,)dnl
945 case "$host_os" in 1205 case "$host_os" in
946 # Guess yes on HP-UX 11. 1206 # Guess yes on HP-UX 11.
947 hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";; 1207 hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
948 # Guess no on HP-UX 10 and older. 1208 # Guess no on HP-UX 10 and older.
949 hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";; 1209 hpux*) gl_cv_func_printf_flag_leftadjust="guessing no";;
950 # Guess yes on Android. 1210 # Guess yes on Android.
951 linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";; 1211 linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
952 # Guess yes on native Windows. 1212 # Guess yes on native Windows.
953 mingw*) gl_cv_func_printf_flag_leftadjust="guessing yes";; 1213 mingw* | windows*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
954 # Guess yes otherwise. 1214 # Guess yes otherwise.
955 *) gl_cv_func_printf_flag_leftadjust="guessing yes";; 1215 *) gl_cv_func_printf_flag_leftadjust="guessing yes";;
956 esac 1216 esac
957changequote([,])dnl 1217changequote([,])dnl
958 ]) 1218 ])
@@ -990,18 +1250,62 @@ int main ()
990 [ 1250 [
991changequote(,)dnl 1251changequote(,)dnl
992 case "$host_os" in 1252 case "$host_os" in
993 # Guess yes on glibc systems. 1253 # Guess yes on glibc systems.
994 *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";; 1254 *-gnu* | gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
995 # Guess yes on musl systems. 1255 # Guess yes on musl systems.
996 *-musl*) gl_cv_func_printf_flag_zero="guessing yes";; 1256 *-musl* | midipix*) gl_cv_func_printf_flag_zero="guessing yes";;
997 # Guess yes on BeOS. 1257 # Guess yes on BeOS.
998 beos*) gl_cv_func_printf_flag_zero="guessing yes";; 1258 beos*) gl_cv_func_printf_flag_zero="guessing yes";;
999 # Guess no on Android. 1259 # Guess no on Android.
1000 linux*-android*) gl_cv_func_printf_flag_zero="guessing no";; 1260 linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
1001 # Guess no on native Windows. 1261 # Guess no on native Windows.
1002 mingw*) gl_cv_func_printf_flag_zero="guessing no";; 1262 mingw* | windows*) gl_cv_func_printf_flag_zero="guessing no";;
1003 # If we don't know, obey --enable-cross-guesses. 1263 # If we don't know, obey --enable-cross-guesses.
1004 *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";; 1264 *) gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
1265 esac
1266changequote([,])dnl
1267 ])
1268 ])
1269])
1270
1271dnl Test whether the *printf family of functions supports the # flag with a
1272dnl zero precision and a zero value in the 'x' and 'X' directives correctly.
1273dnl ISO C and POSIX specify that for the 'd', 'i', 'b', 'o', 'u', 'x', 'X'
1274dnl directives: "The result of converting a zero value with a precision of
1275dnl zero is no characters." But on Mac OS X 10.5, for the 'x', 'X' directives,
1276dnl when a # flag is present, the output is "0" instead of "".
1277dnl Result is gl_cv_func_printf_flag_alt_precision_zero.
1278
1279AC_DEFUN([gl_PRINTF_FLAG_ALT_PRECISION_ZERO],
1280[
1281 AC_REQUIRE([AC_PROG_CC])
1282 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1283 AC_CACHE_CHECK([whether printf supports the alternative flag with a zero precision],
1284 [gl_cv_func_printf_flag_alt_precision_zero],
1285 [
1286 AC_RUN_IFELSE(
1287 [AC_LANG_SOURCE([[
1288#include <stdio.h>
1289static char buf[10];
1290int main ()
1291{
1292 int result = 0;
1293 if (sprintf (buf, "%#.0x %d", 0, 33, 44) > 0 + 3)
1294 result |= 1;
1295 return result;
1296}]])],
1297 [gl_cv_func_printf_flag_alt_precision_zero=yes],
1298 [gl_cv_func_printf_flag_alt_precision_zero=no],
1299 [
1300changequote(,)dnl
1301 case "$host_os" in
1302 # Guess no only on macOS 10..12 systems.
1303 darwin[0-9] | darwin[0-9].* | \
1304 darwin1[0-9] | darwin1[0-9].* | \
1305 darwin2[0-1] | darwin2[0-1].*)
1306 gl_cv_func_printf_flag_alt_precision_zero="guessing no" ;;
1307 darwin*) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
1308 *) gl_cv_func_printf_flag_alt_precision_zero="guessing yes" ;;
1005 esac 1309 esac
1006changequote([,])dnl 1310changequote([,])dnl
1007 ]) 1311 ])
@@ -1054,12 +1358,12 @@ int main ()
1054changequote(,)dnl 1358changequote(,)dnl
1055 case "$host_os" in 1359 case "$host_os" in
1056 # Guess no only on Solaris, native Windows, and BeOS systems. 1360 # Guess no only on Solaris, native Windows, and BeOS systems.
1057 solaris*) gl_cv_func_printf_precision="guessing no" ;; 1361 solaris*) gl_cv_func_printf_precision="guessing no" ;;
1058 mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;; 1362 mingw* | windows* | pw*) gl_cv_func_printf_precision="guessing no" ;;
1059 beos*) gl_cv_func_printf_precision="guessing no" ;; 1363 beos*) gl_cv_func_printf_precision="guessing no" ;;
1060 # Guess yes on Android. 1364 # Guess yes on Android.
1061 linux*-android*) gl_cv_func_printf_precision="guessing yes" ;; 1365 linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
1062 *) gl_cv_func_printf_precision="guessing yes" ;; 1366 *) gl_cv_func_printf_precision="guessing yes" ;;
1063 esac 1367 esac
1064changequote([,])dnl 1368changequote([,])dnl
1065 ]) 1369 ])
@@ -1239,7 +1543,7 @@ changequote(,)dnl
1239 # Guess yes on glibc systems. 1543 # Guess yes on glibc systems.
1240 *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";; 1544 *-gnu* | gnu*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1241 # Guess yes on musl systems. 1545 # Guess yes on musl systems.
1242 *-musl*) gl_cv_func_snprintf_truncation_c99="guessing yes";; 1546 *-musl* | midipix*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1243 # Guess yes on FreeBSD >= 5. 1547 # Guess yes on FreeBSD >= 5.
1244 freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";; 1548 freebsd[1-4].*) gl_cv_func_snprintf_truncation_c99="guessing no";;
1245 freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";; 1549 freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
@@ -1275,7 +1579,7 @@ changequote(,)dnl
1275 # Guess yes on Android. 1579 # Guess yes on Android.
1276 linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";; 1580 linux*-android*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
1277 # Guess no on native Windows. 1581 # Guess no on native Windows.
1278 mingw*) gl_cv_func_snprintf_truncation_c99="guessing no";; 1582 mingw* | windows*) gl_cv_func_snprintf_truncation_c99="guessing no";;
1279 # If we don't know, obey --enable-cross-guesses. 1583 # If we don't know, obey --enable-cross-guesses.
1280 *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";; 1584 *) gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
1281 esac 1585 esac
@@ -1344,7 +1648,7 @@ changequote(,)dnl
1344 # Guess yes on glibc systems. 1648 # Guess yes on glibc systems.
1345 *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";; 1649 *-gnu* | gnu*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1346 # Guess yes on musl systems. 1650 # Guess yes on musl systems.
1347 *-musl*) gl_cv_func_snprintf_retval_c99="guessing yes";; 1651 *-musl* | midipix*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1348 # Guess yes on FreeBSD >= 5. 1652 # Guess yes on FreeBSD >= 5.
1349 freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";; 1653 freebsd[1-4].*) gl_cv_func_snprintf_retval_c99="guessing no";;
1350 freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";; 1654 freebsd* | kfreebsd*) gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1372,7 +1676,8 @@ changequote(,)dnl
1372 linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";; 1676 linux*-android*) gl_cv_func_snprintf_retval_c99="guessing yes";;
1373changequote([,])dnl 1677changequote([,])dnl
1374 # Guess yes on MSVC, no on mingw. 1678 # Guess yes on MSVC, no on mingw.
1375 mingw*) AC_EGREP_CPP([Known], [ 1679 windows*-msvc*) gl_cv_func_snprintf_retval_c99="guessing yes" ;;
1680 mingw* | windows*) AC_EGREP_CPP([Known], [
1376#ifdef _MSC_VER 1681#ifdef _MSC_VER
1377 Known 1682 Known
1378#endif 1683#endif
@@ -1401,6 +1706,7 @@ AC_DEFUN([gl_SNPRINTF_DIRECTIVE_N],
1401 [ 1706 [
1402 AC_RUN_IFELSE( 1707 AC_RUN_IFELSE(
1403 [AC_LANG_SOURCE([[ 1708 [AC_LANG_SOURCE([[
1709#include <signal.h>
1404#include <stdio.h> 1710#include <stdio.h>
1405#include <string.h> 1711#include <string.h>
1406#if HAVE_SNPRINTF 1712#if HAVE_SNPRINTF
@@ -1417,11 +1723,18 @@ static int my_snprintf (char *buf, int size, const char *format, ...)
1417 return ret; 1723 return ret;
1418} 1724}
1419#endif 1725#endif
1726static void
1727abort_handler (int sig)
1728{
1729 (void) sig;
1730 _exit (1);
1731}
1420static char fmtstring[10]; 1732static char fmtstring[10];
1421static char buf[100]; 1733static char buf[100];
1422int main () 1734int main ()
1423{ 1735{
1424 int count = -1; 1736 int count = -1;
1737 signal (SIGABRT, abort_handler);
1425 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2) 1738 /* Copy the format string. Some systems (glibc with _FORTIFY_SOURCE=2)
1426 support %n in format strings in read-only memory but not in writable 1739 support %n in format strings in read-only memory but not in writable
1427 memory. */ 1740 memory. */
@@ -1447,7 +1760,7 @@ int main ()
1447 ;; 1760 ;;
1448changequote(,)dnl 1761changequote(,)dnl
1449 # Guess yes on musl systems. 1762 # Guess yes on musl systems.
1450 *-musl*) gl_cv_func_snprintf_directive_n="guessing yes";; 1763 *-musl* | midipix*) gl_cv_func_snprintf_directive_n="guessing yes";;
1451 # Guess yes on FreeBSD >= 5. 1764 # Guess yes on FreeBSD >= 5.
1452 freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";; 1765 freebsd[1-4].*) gl_cv_func_snprintf_directive_n="guessing no";;
1453 freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";; 1766 freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
@@ -1476,7 +1789,7 @@ changequote(,)dnl
1476 # Guess no on Android. 1789 # Guess no on Android.
1477 linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";; 1790 linux*-android*) gl_cv_func_snprintf_directive_n="guessing no";;
1478 # Guess no on native Windows. 1791 # Guess no on native Windows.
1479 mingw*) gl_cv_func_snprintf_directive_n="guessing no";; 1792 mingw* | windows*) gl_cv_func_snprintf_directive_n="guessing no";;
1480 # If we don't know, obey --enable-cross-guesses. 1793 # If we don't know, obey --enable-cross-guesses.
1481 *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";; 1794 *) gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
1482changequote([,])dnl 1795changequote([,])dnl
@@ -1524,11 +1837,11 @@ int main()
1524 [gl_cv_func_snprintf_size1=yes], 1837 [gl_cv_func_snprintf_size1=yes],
1525 [gl_cv_func_snprintf_size1=no], 1838 [gl_cv_func_snprintf_size1=no],
1526 [case "$host_os" in 1839 [case "$host_os" in
1527 # Guess yes on Android. 1840 # Guess yes on Android.
1528 linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;; 1841 linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
1529 # Guess yes on native Windows. 1842 # Guess yes on native Windows.
1530 mingw*) gl_cv_func_snprintf_size1="guessing yes" ;; 1843 mingw* | windows*) gl_cv_func_snprintf_size1="guessing yes" ;;
1531 *) gl_cv_func_snprintf_size1="guessing yes" ;; 1844 *) gl_cv_func_snprintf_size1="guessing yes" ;;
1532 esac 1845 esac
1533 ]) 1846 ])
1534 ]) 1847 ])
@@ -1601,128 +1914,320 @@ int main()
1601 [ 1914 [
1602changequote(,)dnl 1915changequote(,)dnl
1603 case "$host_os" in 1916 case "$host_os" in
1604 # Guess yes on glibc systems. 1917 # Guess yes on glibc systems.
1605 *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1918 *-gnu* | gnu*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1606 # Guess yes on musl systems. 1919 # Guess yes on musl systems.
1607 *-musl*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1920 *-musl* | midipix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1608 # Guess yes on FreeBSD >= 5. 1921 # Guess yes on FreeBSD >= 5.
1609 freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 1922 freebsd[1-4].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1610 freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1923 freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1611 midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1924 midnightbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1612 # Guess yes on Mac OS X >= 10.3. 1925 # Guess yes on Mac OS X >= 10.3.
1613 darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 1926 darwin[1-6].*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1614 darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1927 darwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1615 # Guess yes on Cygwin. 1928 # Guess yes on Cygwin.
1616 cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1929 cygwin*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1617 # Guess yes on Solaris >= 2.6. 1930 # Guess yes on Solaris >= 2.6.
1618 solaris2.[0-5] | solaris2.[0-5].*) 1931 solaris2.[0-5] | solaris2.[0-5].*)
1619 gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 1932 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1620 solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1933 solaris*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1621 # Guess yes on AIX >= 4. 1934 # Guess yes on AIX >= 4.
1622 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 1935 aix[1-3]*) gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1623 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1936 aix*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1624 # Guess yes on IRIX >= 6.5. 1937 # Guess yes on IRIX >= 6.5.
1625 irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1938 irix6.5) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1626 # Guess yes on NetBSD >= 3. 1939 # Guess yes on NetBSD >= 3.
1627 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*) 1940 netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
1628 gl_cv_func_vsnprintf_zerosize_c99="guessing no";; 1941 gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
1629 netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1942 netbsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1630 # Guess yes on BeOS. 1943 # Guess yes on BeOS.
1631 beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1944 beos*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1632 # Guess yes on Android. 1945 # Guess yes on Android.
1633 linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1946 linux*-android*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1634 # Guess yes on native Windows. 1947 # Guess yes on native Windows.
1635 mingw* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";; 1948 mingw* | windows* | pw*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
1636 # If we don't know, obey --enable-cross-guesses. 1949 # If we don't know, obey --enable-cross-guesses.
1637 *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";; 1950 *) gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
1638 esac 1951 esac
1639changequote([,])dnl 1952changequote([,])dnl
1640 ]) 1953 ])
1641 ]) 1954 ])
1642]) 1955])
1643 1956
1957dnl Test whether the swprintf function works correctly when it produces output
1958dnl that contains null wide characters.
1959dnl Result is gl_cv_func_swprintf_works.
1960
1961AC_DEFUN([gl_SWPRINTF_WORKS],
1962[
1963 AC_REQUIRE([AC_PROG_CC])
1964 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
1965 AC_CHECK_FUNCS_ONCE([swprintf])
1966 AC_CACHE_CHECK([whether swprintf works],
1967 [gl_cv_func_swprintf_works],
1968 [
1969 AC_RUN_IFELSE(
1970 [AC_LANG_SOURCE([[
1971#ifndef __USE_MINGW_ANSI_STDIO
1972# define __USE_MINGW_ANSI_STDIO 1
1973#endif
1974#include <stdio.h>
1975#include <wchar.h>
1976int main()
1977{
1978 int result = 0;
1979 { /* This test fails on musl libc 1.2.3, FreeBSD, NetBSD, OpenBSD, macOS, AIX. */
1980 wchar_t buf[5] = { 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF, 0xBEEF };
1981 int ret = swprintf (buf, 4, L"%cz", '\0');
1982 /* Expected result:
1983 ret = 2, buf[0] = 0x0, buf[1] = 0x7a, buf[2] = 0x0, buf[3] = 0xbeef
1984 musl libc 1.2.3:
1985 ret = 2, buf[0] = 0x0, buf[1] = 0x0, buf[2] = 0x0, buf[3] = 0x0
1986 Reported at <https://www.openwall.com/lists/musl/2023/03/22/9>.
1987 FreeBSD 13.1, NetBSD 9.0, OpenBSD 7.2, macOS 12.5, AIX 7.2:
1988 ret = 2, buf[0] = 0x0, buf[1] = 0xbeef, buf[2] = 0xbeef, buf[3] = 0xbeef
1989 */
1990 if (ret < 0 || buf[1] != 'z')
1991 result |= 1;
1992 }
1993 { /* This test fails on mingw. */
1994 wchar_t buf[2];
1995 int ret = swprintf (buf, 2, L"%lc", (wint_t)0);
1996 /* Expected: ret = 1
1997 mingw: ret = 0
1998 */
1999 if (ret != 1)
2000 result |= 2;
2001 }
2002 return result;
2003}]])],
2004 [gl_cv_func_swprintf_works=yes],
2005 [gl_cv_func_swprintf_works=no],
2006 [case "$host_os" in
2007 # Guess yes on glibc systems.
2008 *-gnu* | gnu*) gl_cv_func_swprintf_works="guessing yes";;
2009 # Guess no on musl systems.
2010 *-musl* | midipix*) gl_cv_func_swprintf_works="guessing no";;
2011 # Guess no on FreeBSD, NetBSD, OpenBSD, macOS, AIX.
2012 freebsd* | midnightbsd* | netbsd* | openbsd* | darwin* | aix*)
2013 gl_cv_func_swprintf_works="guessing no";;
2014 # Guess no on native Windows.
2015 mingw* | windows* | pw*) gl_cv_func_swprintf_works="guessing no";;
2016 # If we don't know, obey --enable-cross-guesses.
2017 *) gl_cv_func_swprintf_works="$gl_cross_guess_normal";;
2018 esac
2019 ])
2020 ])
2021])
2022
2023dnl Test whether the *wprintf family of functions supports the 'a' and 'A'
2024dnl conversion specifier for hexadecimal output of 'long double' numbers.
2025dnl (ISO C99, POSIX:2001)
2026dnl Result is gl_cv_func_swprintf_directive_la.
2027
2028AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LA],
2029[
2030 AC_REQUIRE([AC_PROG_CC])
2031 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2032 AC_CACHE_CHECK([whether swprintf supports the 'La' and 'LA' directives],
2033 [gl_cv_func_swprintf_directive_la],
2034 [
2035 AC_RUN_IFELSE(
2036 [AC_LANG_SOURCE([[
2037#include <stdio.h>
2038#include <wchar.h>
2039static wchar_t buf[100];
2040int main ()
2041{
2042 int result = 0;
2043 /* This catches a glibc 2.15, Haiku 2022, NetBSD 10.0 bug. */
2044 if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
2045 L"%La %d", 3.1416015625L, 33, 44, 55) < 0
2046 || (wcscmp (buf, L"0x1.922p+1 33") != 0
2047 && wcscmp (buf, L"0x3.244p+0 33") != 0
2048 && wcscmp (buf, L"0x6.488p-1 33") != 0
2049 && wcscmp (buf, L"0xc.91p-2 33") != 0))
2050 result |= 1;
2051 return result;
2052}]])],
2053 [gl_cv_func_swprintf_directive_la=yes],
2054 [gl_cv_func_swprintf_directive_la=no],
2055 [case "$host_os" in
2056 # Guess yes on glibc >= 2.17 systems.
2057 *-gnu* | gnu*)
2058 AC_EGREP_CPP([Unlucky], [
2059 #include <features.h>
2060 #ifdef __GNU_LIBRARY__
2061 #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16) || (__GLIBC__ > 2)) && !defined __UCLIBC__
2062 Unlucky
2063 #endif
2064 #endif
2065 ],
2066 [gl_cv_func_swprintf_directive_la="guessing yes"],
2067 [gl_cv_func_swprintf_directive_la="guessing no"])
2068 ;;
2069 # Guess yes on musl systems.
2070 *-musl* | midipix*) gl_cv_func_swprintf_directive_la="guessing yes";;
2071 # Guess yes on Android.
2072 linux*-android*) gl_cv_func_swprintf_directive_la="guessing yes";;
2073 # Guess no on NetBSD.
2074 netbsd*) gl_cv_func_swprintf_directive_la="guessing no";;
2075 # Guess no on native Windows.
2076 mingw* | windows*) gl_cv_func_swprintf_directive_la="guessing no";;
2077 # If we don't know, obey --enable-cross-guesses.
2078 *) gl_cv_func_swprintf_directive_la="$gl_cross_guess_normal";;
2079 esac
2080 ])
2081 ])
2082])
2083
2084dnl Test whether the *wprintf family of functions supports the 'lc' conversion
2085dnl specifier for all wide characters.
2086dnl (ISO C11, POSIX:2001)
2087dnl Result is gl_cv_func_swprintf_directive_lc.
2088
2089AC_DEFUN([gl_SWPRINTF_DIRECTIVE_LC],
2090[
2091 AC_REQUIRE([AC_PROG_CC])
2092 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
2093 AC_CACHE_CHECK([whether swprintf supports the 'lc' directive],
2094 [gl_cv_func_swprintf_directive_lc],
2095 [
2096 AC_RUN_IFELSE(
2097 [AC_LANG_SOURCE([[
2098#include <stdio.h>
2099#include <wchar.h>
2100static wchar_t buf[100];
2101static wint_t L_invalid = (wchar_t) 0x76543210;
2102int main ()
2103{
2104 int result = 0;
2105 /* This catches a musl libc 1.2.4, Android bug.
2106 Reported at <https://www.openwall.com/lists/musl/2023/06/12/3>. */
2107 if (swprintf (buf, sizeof (buf) / sizeof (wchar_t),
2108 L"%lc %d", L_invalid, 33, 44, 55) < 0)
2109 result |= 1;
2110 return result;
2111}]])],
2112 [gl_cv_func_swprintf_directive_lc=yes],
2113 [gl_cv_func_swprintf_directive_lc=no],
2114 [case "$host_os" in
2115 # Guess yes on glibc systems.
2116 *-gnu* | gnu*) gl_cv_func_swprintf_directive_lc="guessing yes";;
2117 # Guess no on musl systems.
2118 *-musl* | midipix*) gl_cv_func_swprintf_directive_lc="guessing no";;
2119 # Guess no on Android.
2120 linux*-android*) gl_cv_func_swprintf_directive_lc="guessing no";;
2121 # Guess yes on native Windows.
2122 mingw* | windows*) gl_cv_func_swprintf_directive_lc="guessing yes";;
2123 # If we don't know, obey --enable-cross-guesses.
2124 *) gl_cv_func_swprintf_directive_lc="$gl_cross_guess_normal";;
2125 esac
2126 ])
2127 ])
2128])
2129
1644dnl The results of these tests on various platforms are: 2130dnl The results of these tests on various platforms are:
1645dnl 2131dnl
1646dnl 1 = gl_PRINTF_SIZES_C99 2132dnl 1 = gl_PRINTF_SIZES_C99
1647dnl 2 = gl_PRINTF_LONG_DOUBLE 2133dnl 2 = gl_PRINTF_SIZES_C23
1648dnl 3 = gl_PRINTF_INFINITE 2134dnl 3 = gl_PRINTF_LONG_DOUBLE
1649dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE 2135dnl 4 = gl_PRINTF_INFINITE
1650dnl 5 = gl_PRINTF_DIRECTIVE_A 2136dnl 5 = gl_PRINTF_INFINITE_LONG_DOUBLE
1651dnl 6 = gl_PRINTF_DIRECTIVE_F 2137dnl 6 = gl_PRINTF_DIRECTIVE_A
1652dnl 7 = gl_PRINTF_DIRECTIVE_N 2138dnl 7 = gl_PRINTF_DIRECTIVE_B
1653dnl 8 = gl_PRINTF_DIRECTIVE_LS 2139dnl 8 = gl_PRINTF_DIRECTIVE_UPPERCASE_B
1654dnl 9 = gl_PRINTF_POSITIONS 2140dnl 9 = gl_PRINTF_DIRECTIVE_F
1655dnl 10 = gl_PRINTF_FLAG_GROUPING 2141dnl 10 = gl_PRINTF_DIRECTIVE_N
1656dnl 11 = gl_PRINTF_FLAG_LEFTADJUST 2142dnl 11 = gl_PRINTF_DIRECTIVE_LS
1657dnl 12 = gl_PRINTF_FLAG_ZERO 2143dnl 12 = gl_PRINTF_DIRECTIVE_LC
1658dnl 13 = gl_PRINTF_PRECISION 2144dnl 13 = gl_PRINTF_POSITIONS
1659dnl 14 = gl_PRINTF_ENOMEM 2145dnl 14 = gl_PRINTF_FLAG_GROUPING
1660dnl 15 = gl_SNPRINTF_PRESENCE 2146dnl 15 = gl_PRINTF_FLAG_LEFTADJUST
1661dnl 16 = gl_SNPRINTF_TRUNCATION_C99 2147dnl 16 = gl_PRINTF_FLAG_ZERO
1662dnl 17 = gl_SNPRINTF_RETVAL_C99 2148dnl 17 = gl_PRINTF_FLAG_ALT_PRECISION_ZERO
1663dnl 18 = gl_SNPRINTF_DIRECTIVE_N 2149dnl 18 = gl_PRINTF_PRECISION
1664dnl 19 = gl_SNPRINTF_SIZE1 2150dnl 19 = gl_PRINTF_ENOMEM
1665dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 2151dnl 20 = gl_SNPRINTF_PRESENCE
2152dnl 21 = gl_SNPRINTF_TRUNCATION_C99
2153dnl 22 = gl_SNPRINTF_RETVAL_C99
2154dnl 23 = gl_SNPRINTF_DIRECTIVE_N
2155dnl 24 = gl_SNPRINTF_SIZE1
2156dnl 25 = gl_VSNPRINTF_ZEROSIZE_C99
2157dnl 26 = gl_SWPRINTF_WORKS
2158dnl 27 = gl_SWPRINTF_DIRECTIVE_LA
2159dnl 28 = gl_SWPRINTF_DIRECTIVE_LC
1666dnl 2160dnl
1667dnl 1 = checking whether printf supports size specifiers as in C99... 2161dnl 1 = checking whether printf supports size specifiers as in C99...
1668dnl 2 = checking whether printf supports 'long double' arguments... 2162dnl 2 = checking whether printf supports size specifiers as in C23...
1669dnl 3 = checking whether printf supports infinite 'double' arguments... 2163dnl 3 = checking whether printf supports 'long double' arguments...
1670dnl 4 = checking whether printf supports infinite 'long double' arguments... 2164dnl 4 = checking whether printf supports infinite 'double' arguments...
1671dnl 5 = checking whether printf supports the 'a' and 'A' directives... 2165dnl 5 = checking whether printf supports infinite 'long double' arguments...
1672dnl 6 = checking whether printf supports the 'F' directive... 2166dnl 6 = checking whether printf supports the 'a' and 'A' directives...
1673dnl 7 = checking whether printf supports the 'n' directive... 2167dnl 7 = checking whether printf supports the 'b' directive...
1674dnl 8 = checking whether printf supports the 'ls' directive... 2168dnl 8 = checking whether printf supports the 'B' directive...
1675dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... 2169dnl 9 = checking whether printf supports the 'F' directive...
1676dnl 10 = checking whether printf supports the grouping flag... 2170dnl 10 = checking whether printf supports the 'n' directive...
1677dnl 11 = checking whether printf supports the left-adjust flag correctly... 2171dnl 11 = checking whether printf supports the 'ls' directive...
1678dnl 12 = checking whether printf supports the zero flag correctly... 2172dnl 12 = checking whether printf supports the 'lc' directive correctly...
1679dnl 13 = checking whether printf supports large precisions... 2173dnl 13 = checking whether printf supports POSIX/XSI format strings with positions...
1680dnl 14 = checking whether printf survives out-of-memory conditions... 2174dnl 14 = checking whether printf supports the grouping flag...
1681dnl 15 = checking for snprintf... 2175dnl 15 = checking whether printf supports the left-adjust flag correctly...
1682dnl 16 = checking whether snprintf truncates the result as in C99... 2176dnl 16 = checking whether printf supports the zero flag correctly...
1683dnl 17 = checking whether snprintf returns a byte count as in C99... 2177dnl 17 = checking whether printf supports the alternative flag with a zero precision...
1684dnl 18 = checking whether snprintf fully supports the 'n' directive... 2178dnl 18 = checking whether printf supports large precisions...
1685dnl 19 = checking whether snprintf respects a size of 1... 2179dnl 19 = checking whether printf survives out-of-memory conditions...
1686dnl 20 = checking whether vsnprintf respects a zero size as in C99... 2180dnl 20 = checking for snprintf...
2181dnl 21 = checking whether snprintf truncates the result as in C99...
2182dnl 22 = checking whether snprintf returns a byte count as in C99...
2183dnl 23 = checking whether snprintf fully supports the 'n' directive...
2184dnl 24 = checking whether snprintf respects a size of 1...
2185dnl 25 = checking whether vsnprintf respects a zero size as in C99...
2186dnl 26 = checking whether swprintf works...
2187dnl 27 = checking whether swprintf supports the 'La' and 'LA' directives...
2188dnl 28 = checking whether swprintf supports the 'lc' directive...
1687dnl 2189dnl
1688dnl . = yes, # = no. 2190dnl . = yes, # = no.
1689dnl 2191dnl
1690dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2192dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
1691dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . 2193dnl musl libc 1.2.3 . # . . . . # # . . . # . . . . ? . . . . . . . . # . #
1692dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . 2194dnl glibc 2.35 . # . . . . . . . . . . . . . . . . . . . . . . . . . .
1693dnl FreeBSD 13.0 . . . . # . . . . . . . . # . . . . . . 2195dnl glibc 2.5 . # . . . . # # . . . . . . . . . . . . . . . . . . # .
1694dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . 2196dnl glibc 2.3.6 . # . . . # # # . . . . . . . . . . . . . . . . . . # .
1695dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . . 2197dnl FreeBSD 14.0 . . . . . # . . . . . . . . . . . . # . . . . . . # . #
1696dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . 2198dnl FreeBSD 13.0 . # . . . # # # . . . . . . . . . . # . . . . . . # . #
1697dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . 2199dnl FreeBSD 5.4, 6.1 . # . . . # # # . . . . . . . # ? . # . . . . . . # ? ?
1698dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . . 2200dnl Mac OS X 10.13.5 . # . . # # # # . # . . . . . . . . . . . . # . . # ? ?
1699dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . 2201dnl Mac OS X 10.5.8 . # . . # # # # . . . . . . . # # . . . . . . . . # ? ?
1700dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . 2202dnl Mac OS X 10.3.9 . # . . . # # # . . . . . . . # # . # . . . . . . # ? ?
1701dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . 2203dnl OpenBSD 6.0, 6.7 . # . . . # # # . . . . . . . . . . # . . . . . . # . #
1702dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . 2204dnl OpenBSD 3.9, 4.0 . # . # # # # # # . # . . # . # ? . # . . . . . . # ? ?
1703dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . . 2205dnl Cygwin 1.7.0 (2009) . # . . # . # # . . ? ? . . . . ? . ? . . . . . . ? ? ?
1704dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . . 2206dnl Cygwin 1.5.25 (2008) . # . . # # # # . . # ? . . . . ? . # . . . . . . ? ? ?
1705dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . . 2207dnl Cygwin 1.5.19 (2006) # # . . # # # # # . # ? . # . # ? # # . . . . . . ? ? ?
1706dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . 2208dnl Solaris 11.4 . # . # # # # # . . # . . . . # . . . . . . . . . . # .
1707dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . 2209dnl Solaris 11.3 . # . . . # # # . . # . . . . . . . . . . . . . . . # .
1708dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # 2210dnl Solaris 11.0 . # . # # # # # . . # . . . . # . . . . . . . . . ? ? ?
1709dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . 2211dnl Solaris 10 . # . # # # # # . . # . . . . # . # . . . . . . . . # .
1710dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . 2212dnl Solaris 2.6 ... 9 # # . # # # # # # . # . . . . # ? # . . . # . . . ? ? ?
1711dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . 2213dnl Solaris 2.5.1 # # . # # # # # # . # . . . . # ? . . # # # # # # ? ? ?
1712dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . 2214dnl AIX 7.1 . # . # # # # # . . . . . . . # . # . . . . . . . # . .
1713dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # 2215dnl AIX 5.2 . # . # # # # # . . . . . . . # ? . . . . . . . . # ? ?
1714dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # 2216dnl AIX 4.3.2, 5.1 # # . # # # # # # . . . . . . # ? . . . . # . . . # ? ?
1715dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . 2217dnl HP-UX 11.31 . # . . . # # # . . . ? . . . # ? . . . . # # . . ? ? ?
1716dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # 2218dnl HP-UX 11.{00,11,23} # # . . . # # # # . . ? . . . # ? . . . . # # . # ? ? ?
1717dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # 2219dnl HP-UX 10.20 # # . # . # # # # . ? ? . . # # ? . . . . # # ? # ? ? ?
1718dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . . 2220dnl IRIX 6.5 # # . # # # # # # . # . . . . # ? . . . . # . . . # ? ?
1719dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . 2221dnl OSF/1 5.1 # # . # # # # # # . . ? . . . # ? . . . . # . . # ? ? ?
1720dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? 2222dnl OSF/1 4.0d # # . # # # # # # . . ? . . . # ? . . # # # # # # ? ? ?
1721dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . 2223dnl NetBSD 9.0 . # . . . # # # . . . . . . . . . . . . . . . . . # . #
1722dnl Haiku . . . # # # . # . . . . . ? . . ? . . . 2224dnl NetBSD 5.0 . # . . # # # # . . . . . . . # ? . # . . . . . . # ? ?
1723dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . 2225dnl NetBSD 4.0 . # ? ? ? ? # # ? . ? . . ? ? ? ? ? ? . . . ? ? ? # ? ?
1724dnl Android 4.3 . . # # # # # # . # . # . # . . . # . . 2226dnl NetBSD 3.0 . # . . . # # # # . ? . # # ? # ? . # . . . . . . # ? ?
1725dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . 2227dnl Haiku . # . . # # # # # . # ? . . . . ? . ? . . ? . . . . # .
1726dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . 2228dnl BeOS # # # . # # # # # . ? ? # . ? . ? # ? . . ? . . . ? ? ?
1727dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . 2229dnl Android 4.3 . # . # # # # # # # # ? . # . # ? . # . . . # . . ? ? ?
1728dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . 2230dnl old mingw / msvcrt # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ?
2231dnl MSVC 9 # # # # # # # # # # . ? # # . # ? # ? # # # # . . # ? ?
2232dnl mingw 2009-2011 . # # . # . # # . . . ? # # . . ? . ? . . . . . . # ? ?
2233dnl mingw-w64 2011 # # # # # # # # # . . ? # # . # ? # ? . # # # . . # ? ?
diff --git a/gl/m4/pthread_rwlock_rdlock.m4 b/gl/m4/pthread_rwlock_rdlock.m4
index ae6a8853..b8b5b117 100644
--- a/gl/m4/pthread_rwlock_rdlock.m4
+++ b/gl/m4/pthread_rwlock_rdlock.m4
@@ -1,5 +1,6 @@
1# pthread_rwlock_rdlock.m4 serial 4 1# pthread_rwlock_rdlock.m4
2dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -34,11 +35,11 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
34dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052 35dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
35AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], 36AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
36[ 37[
37 AC_REQUIRE([gl_THREADLIB_EARLY]) 38 AC_REQUIRE([gl_THREADLIB])
38 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 39 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
39 AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader], 40 AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
40 [gl_cv_pthread_rwlock_rdlock_prefer_writer], 41 [gl_cv_pthread_rwlock_rdlock_prefer_writer],
41 [save_LIBS="$LIBS" 42 [saved_LIBS="$LIBS"
42 LIBS="$LIBS $LIBMULTITHREAD" 43 LIBS="$LIBS $LIBMULTITHREAD"
43 AC_RUN_IFELSE( 44 AC_RUN_IFELSE(
44 [AC_LANG_SOURCE([[ 45 [AC_LANG_SOURCE([[
@@ -156,25 +157,25 @@ main ()
156 [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes], 157 [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
157 [gl_cv_pthread_rwlock_rdlock_prefer_writer=no], 158 [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
158 [case "$host_os" in 159 [case "$host_os" in
159 # Guess no on glibc systems. 160 # Guess no on glibc systems.
160 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 161 *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
161 # Guess no on musl systems. 162 # Guess no on musl systems.
162 *-musl*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 163 *-musl* | midipix*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
163 # Guess no on bionic systems. 164 # Guess no on bionic systems.
164 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;; 165 *-android*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
165 # Guess yes on native Windows with the mingw-w64 winpthreads library. 166 # Guess yes on native Windows with the mingw-w64 winpthreads library.
166 # Guess no on native Windows with the gnulib windows-rwlock module. 167 # Guess no on native Windows with the gnulib windows-rwlock module.
167 mingw*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then 168 mingw* | windows*) if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
168 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes" 169 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
169 else 170 else
170 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" 171 gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
171 fi 172 fi
172 ;; 173 ;;
173 # If we don't know, obey --enable-cross-guesses. 174 # If we don't know, obey --enable-cross-guesses.
174 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;; 175 *) gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
175 esac 176 esac
176 ]) 177 ])
177 LIBS="$save_LIBS" 178 LIBS="$saved_LIBS"
178 ]) 179 ])
179 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in 180 case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
180 *yes) 181 *yes)
diff --git a/gl/m4/realloc.m4 b/gl/m4/realloc.m4
index d22138fc..eb90d588 100644
--- a/gl/m4/realloc.m4
+++ b/gl/m4/realloc.m4
@@ -1,5 +1,6 @@
1# realloc.m4 serial 26 1# realloc.m4
2dnl Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 29
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -16,7 +17,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
16 [[#include <stdlib.h> 17 [[#include <stdlib.h>
17 ]], 18 ]],
18 [[void *p = realloc (0, 0); 19 [[void *p = realloc (0, 0);
19 int result = !p; 20 void * volatile vp = p;
21 int result = !vp;
20 free (p); 22 free (p);
21 return result;]]) 23 return result;]])
22 ], 24 ],
@@ -25,8 +27,8 @@ AC_DEFUN([_AC_FUNC_REALLOC_IF],
25 [case "$host_os" in 27 [case "$host_os" in
26 # Guess yes on platforms where we know the result. 28 # Guess yes on platforms where we know the result.
27 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \ 29 *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
28 | gnu* | *-musl* | midnightbsd* \ 30 | gnu* | *-musl* | midipix* | midnightbsd* \
29 | hpux* | solaris* | cygwin* | mingw* | msys* ) 31 | hpux* | solaris* | cygwin* | mingw* | windows* | msys* )
30 ac_cv_func_realloc_0_nonnull="guessing yes" ;; 32 ac_cv_func_realloc_0_nonnull="guessing yes" ;;
31 # If we don't know, obey --enable-cross-guesses. 33 # If we don't know, obey --enable-cross-guesses.
32 *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;; 34 *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
diff --git a/gl/m4/reallocarray.m4 b/gl/m4/reallocarray.m4
index 1607b7a9..958095e1 100644
--- a/gl/m4/reallocarray.m4
+++ b/gl/m4/reallocarray.m4
@@ -1,5 +1,6 @@
1# reallocarray.m4 serial 3 1# reallocarray.m4
2dnl Copyright (C) 2017-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -11,9 +12,12 @@ AC_DEFUN([gl_FUNC_REALLOCARRAY],
11 12
12 AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) 13 AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
13 AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF]) 14 AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
14 AC_CHECK_FUNCS([reallocarray]) 15 gl_CHECK_FUNCS_ANDROID([reallocarray], [[#include <stdlib.h>]])
15 if test "$ac_cv_func_reallocarray" = no; then 16 if test "$ac_cv_func_reallocarray" = no; then
16 HAVE_REALLOCARRAY=0 17 HAVE_REALLOCARRAY=0
18 case "$gl_cv_onwards_func_reallocarray" in
19 future*) REPLACE_REALLOCARRAY=1 ;;
20 esac
17 elif test "$gl_cv_malloc_ptrdiff" = no; then 21 elif test "$gl_cv_malloc_ptrdiff" = no; then
18 REPLACE_REALLOCARRAY=1 22 REPLACE_REALLOCARRAY=1
19 fi 23 fi
diff --git a/gl/m4/regex.m4 b/gl/m4/regex.m4
index c89a1432..f0101fe6 100644
--- a/gl/m4/regex.m4
+++ b/gl/m4/regex.m4
@@ -1,10 +1,9 @@
1# serial 73 1# regex.m4
2 2# serial 75
3# Copyright (C) 1996-2001, 2003-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 1996-2001, 2003-2024 Free Software Foundation, Inc.
4# 4dnl This file is free software; the Free Software Foundation
5# This file is free software; the Free Software Foundation 5dnl gives unlimited permission to copy and/or distribute it,
6# gives unlimited permission to copy and/or distribute it, 6dnl with or without modifications, as long as this notice is preserved.
7# with or without modifications, as long as this notice is preserved.
8 7
9dnl Initially derived from code in GNU grep. 8dnl Initially derived from code in GNU grep.
10dnl Mostly written by Jim Meyering. 9dnl Mostly written by Jim Meyering.
@@ -15,7 +14,7 @@ AC_DEFUN([gl_REGEX],
15[ 14[
16 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles 15 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
17 AC_ARG_WITH([included-regex], 16 AC_ARG_WITH([included-regex],
18 [AS_HELP_STRING([--without-included-regex], 17 [AS_HELP_STRING([[--without-included-regex]],
19 [don't compile regex; this is the default on systems 18 [don't compile regex; this is the default on systems
20 with recent-enough versions of the GNU C Library 19 with recent-enough versions of the GNU C Library
21 (use with caution on other systems).])]) 20 (use with caution on other systems).])])
@@ -327,10 +326,10 @@ AC_DEFUN([gl_REGEX],
327 [gl_cv_func_re_compile_pattern_working=yes], 326 [gl_cv_func_re_compile_pattern_working=yes],
328 [gl_cv_func_re_compile_pattern_working=no], 327 [gl_cv_func_re_compile_pattern_working=no],
329 [case "$host_os" in 328 [case "$host_os" in
330 # Guess no on native Windows. 329 # Guess no on native Windows.
331 mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;; 330 mingw* | windows*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
332 # Otherwise obey --enable-cross-guesses. 331 # Otherwise obey --enable-cross-guesses.
333 *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;; 332 *) gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
334 esac 333 esac
335 ]) 334 ])
336 ]) 335 ])
diff --git a/gl/m4/servent.m4 b/gl/m4/servent.m4
index 0f35b8b8..422003b4 100644
--- a/gl/m4/servent.m4
+++ b/gl/m4/servent.m4
@@ -1,5 +1,6 @@
1# servent.m4 serial 4 1# servent.m4
2dnl Copyright (C) 2008, 2010-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2008, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -28,7 +29,7 @@ AC_DEFUN([gl_SERVENT],
28 AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32], 29 AC_CACHE_CHECK([for getservbyname in winsock2.h and -lws2_32],
29 [gl_cv_w32_getservbyname], 30 [gl_cv_w32_getservbyname],
30 [gl_cv_w32_getservbyname=no 31 [gl_cv_w32_getservbyname=no
31 gl_save_LIBS="$LIBS" 32 gl_saved_LIBS="$LIBS"
32 LIBS="$LIBS -lws2_32" 33 LIBS="$LIBS -lws2_32"
33 AC_LINK_IFELSE( 34 AC_LINK_IFELSE(
34 [AC_LANG_PROGRAM( 35 [AC_LANG_PROGRAM(
@@ -40,7 +41,7 @@ AC_DEFUN([gl_SERVENT],
40 ]], 41 ]],
41 [[getservbyname(NULL,NULL);]])], 42 [[getservbyname(NULL,NULL);]])],
42 [gl_cv_w32_getservbyname=yes]) 43 [gl_cv_w32_getservbyname=yes])
43 LIBS="$gl_save_LIBS" 44 LIBS="$gl_saved_LIBS"
44 ]) 45 ])
45 if test "$gl_cv_w32_getservbyname" = "yes"; then 46 if test "$gl_cv_w32_getservbyname" = "yes"; then
46 SERVENT_LIB="-lws2_32" 47 SERVENT_LIB="-lws2_32"
diff --git a/gl/m4/setenv.m4 b/gl/m4/setenv.m4
index 16f9eb55..e7f00f39 100644
--- a/gl/m4/setenv.m4
+++ b/gl/m4/setenv.m4
@@ -1,5 +1,6 @@
1# setenv.m4 serial 30 1# setenv.m4
2dnl Copyright (C) 2001-2004, 2006-2023 Free Software Foundation, Inc. 2# serial 33
3dnl Copyright (C) 2001-2004, 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -35,12 +36,12 @@ AC_DEFUN([gl_FUNC_SETENV],
35 ]])], 36 ]])],
36 [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no], 37 [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
37 [case "$host_os" in 38 [case "$host_os" in
38 # Guess yes on glibc systems. 39 # Guess yes on glibc systems.
39 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;; 40 *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
40 # Guess yes on musl systems. 41 # Guess yes on musl systems.
41 *-musl*) gl_cv_func_setenv_works="guessing yes" ;; 42 *-musl* | midipix*) gl_cv_func_setenv_works="guessing yes" ;;
42 # If we don't know, obey --enable-cross-guesses. 43 # If we don't know, obey --enable-cross-guesses.
43 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;; 44 *) gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
44 esac 45 esac
45 ])]) 46 ])])
46 case "$gl_cv_func_setenv_works" in 47 case "$gl_cv_func_setenv_works" in
@@ -151,11 +152,10 @@ int unsetenv (const char *name);
151# Prerequisites of lib/setenv.c. 152# Prerequisites of lib/setenv.c.
152AC_DEFUN([gl_PREREQ_SETENV], 153AC_DEFUN([gl_PREREQ_SETENV],
153[ 154[
154 AC_REQUIRE([AC_FUNC_ALLOCA])
155 AC_REQUIRE([gl_ENVIRON]) 155 AC_REQUIRE([gl_ENVIRON])
156 AC_CHECK_HEADERS_ONCE([unistd.h]) 156 AC_CHECK_HEADERS_ONCE([unistd.h])
157 AC_CHECK_HEADERS([search.h]) 157 AC_CHECK_HEADERS([search.h])
158 AC_CHECK_FUNCS([tsearch]) 158 gl_CHECK_FUNCS_ANDROID([tsearch], [[#include <search.h>]])
159]) 159])
160 160
161# Prerequisites of lib/unsetenv.c. 161# Prerequisites of lib/unsetenv.c.
diff --git a/gl/m4/setlocale_null.m4 b/gl/m4/setlocale_null.m4
index 032119d0..e5b7d28b 100644
--- a/gl/m4/setlocale_null.m4
+++ b/gl/m4/setlocale_null.m4
@@ -1,5 +1,6 @@
1# setlocale_null.m4 serial 5 1# setlocale_null.m4
2dnl Copyright (C) 2019-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 2019-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -13,11 +14,25 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
13 AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe], 14 AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
14 [gl_cv_func_setlocale_null_all_mtsafe], 15 [gl_cv_func_setlocale_null_all_mtsafe],
15 [case "$host_os" in 16 [case "$host_os" in
16 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin. 17 # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku.
17 *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*) 18 *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku*)
18 gl_cv_func_setlocale_null_all_mtsafe=no ;; 19 gl_cv_func_setlocale_null_all_mtsafe=no ;;
20 # Guess no on Cygwin < 3.4.6.
21 cygwin*)
22 AC_EGREP_CPP([Lucky user],
23 [
24#if defined __CYGWIN__
25 #include <cygwin/version.h>
26 #if CYGWIN_VERSION_DLL_COMBINED >= CYGWIN_VERSION_DLL_MAKE_COMBINED (3004, 6)
27 Lucky user
28 #endif
29#endif
30 ],
31 [gl_cv_func_setlocale_null_all_mtsafe=yes],
32 [gl_cv_func_setlocale_null_all_mtsafe=no])
33 ;;
19 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows. 34 # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
20 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*) 35 *-gnu* | gnu* | hpux* | irix* | solaris* | mingw* | windows*)
21 gl_cv_func_setlocale_null_all_mtsafe=yes ;; 36 gl_cv_func_setlocale_null_all_mtsafe=yes ;;
22 # If we don't know, obey --enable-cross-guesses. 37 # If we don't know, obey --enable-cross-guesses.
23 *) 38 *)
@@ -26,7 +41,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
26 ]) 41 ])
27 dnl On platforms without multithreading, there is no issue. 42 dnl On platforms without multithreading, there is no issue.
28 case "$host_os" in 43 case "$host_os" in
29 mingw*) ;; 44 mingw* | windows*) ;;
30 *) 45 *)
31 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then 46 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
32 gl_cv_func_setlocale_null_all_mtsafe="trivially yes" 47 gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
@@ -48,7 +63,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
48 openbsd* | aix*) 63 openbsd* | aix*)
49 gl_cv_func_setlocale_null_one_mtsafe=no ;; 64 gl_cv_func_setlocale_null_one_mtsafe=no ;;
50 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows. 65 # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
51 *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*) 66 *-gnu* | gnu* | *-musl* | midipix* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw* | windows*)
52 gl_cv_func_setlocale_null_one_mtsafe=yes ;; 67 gl_cv_func_setlocale_null_one_mtsafe=yes ;;
53 # If we don't know, obey --enable-cross-guesses. 68 # If we don't know, obey --enable-cross-guesses.
54 *) 69 *)
@@ -57,7 +72,7 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
57 ]) 72 ])
58 dnl On platforms without multithreading, there is no issue. 73 dnl On platforms without multithreading, there is no issue.
59 case "$host_os" in 74 case "$host_os" in
60 mingw*) ;; 75 mingw* | windows*) ;;
61 *) 76 *)
62 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then 77 if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
63 gl_cv_func_setlocale_null_one_mtsafe="trivially yes" 78 gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
@@ -74,20 +89,25 @@ AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
74 dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c. 89 dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
75 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then 90 if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
76 case "$host_os" in 91 case "$host_os" in
77 mingw*) LIB_SETLOCALE_NULL= ;; 92 mingw* | windows*)
93 SETLOCALE_NULL_LIB=
94 ;;
78 *) 95 *)
79 gl_WEAK_SYMBOLS 96 gl_WEAK_SYMBOLS
80 case "$gl_cv_have_weak" in 97 case "$gl_cv_have_weak" in
81 *yes) LIB_SETLOCALE_NULL= ;; 98 *yes) SETLOCALE_NULL_LIB= ;;
82 *) LIB_SETLOCALE_NULL="$LIBPTHREAD" ;; 99 *) SETLOCALE_NULL_LIB="$LIBPTHREAD" ;;
83 esac 100 esac
84 ;; 101 ;;
85 esac 102 esac
86 else 103 else
87 LIB_SETLOCALE_NULL= 104 SETLOCALE_NULL_LIB=
88 fi 105 fi
89 dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX 106 dnl SETLOCALE_NULL_LIB is expected to be '-pthread' or '-lpthread' on AIX
90 dnl with gcc or xlc, and empty otherwise. 107 dnl with gcc or xlc, and empty otherwise.
108 AC_SUBST([SETLOCALE_NULL_LIB])
109 dnl For backward compatibility.
110 LIB_SETLOCALE_NULL="$SETLOCALE_NULL_LIB"
91 AC_SUBST([LIB_SETLOCALE_NULL]) 111 AC_SUBST([LIB_SETLOCALE_NULL])
92]) 112])
93 113
diff --git a/gl/m4/sha256.m4 b/gl/m4/sha256.m4
index 4d1d1dda..ad5596a4 100644
--- a/gl/m4/sha256.m4
+++ b/gl/m4/sha256.m4
@@ -1,5 +1,6 @@
1# sha256.m4 serial 8 1# sha256.m4
2dnl Copyright (C) 2005, 2008-2023 Free Software Foundation, Inc. 2# serial 8
3dnl Copyright (C) 2005, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/size_max.m4 b/gl/m4/size_max.m4
index 0763366d..df91cf06 100644
--- a/gl/m4/size_max.m4
+++ b/gl/m4/size_max.m4
@@ -1,5 +1,6 @@
1# size_max.m4 serial 12 1# size_max.m4
2dnl Copyright (C) 2003, 2005-2006, 2008-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2003, 2005-2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/snprintf.m4 b/gl/m4/snprintf.m4
index 4b5fbdbf..6dbe146f 100644
--- a/gl/m4/snprintf.m4
+++ b/gl/m4/snprintf.m4
@@ -1,5 +1,6 @@
1# snprintf.m4 serial 7 1# snprintf.m4
2dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc. 2# serial 7
3dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/socketlib.m4 b/gl/m4/socketlib.m4
index a556af1e..09f01161 100644
--- a/gl/m4/socketlib.m4
+++ b/gl/m4/socketlib.m4
@@ -1,5 +1,6 @@
1# socketlib.m4 serial 3 1# socketlib.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 4
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -18,7 +19,7 @@ AC_DEFUN([gl_SOCKETLIB],
18 dnl defined through -lws2_32), we need to call it. 19 dnl defined through -lws2_32), we need to call it.
19 AC_CACHE_CHECK([for WSAStartup], 20 AC_CACHE_CHECK([for WSAStartup],
20 [gl_cv_func_wsastartup], [ 21 [gl_cv_func_wsastartup], [
21 gl_save_LIBS="$LIBS" 22 gl_saved_LIBS="$LIBS"
22 LIBS="$LIBS -lws2_32" 23 LIBS="$LIBS -lws2_32"
23 AC_LINK_IFELSE( 24 AC_LINK_IFELSE(
24 [AC_LANG_PROGRAM([[ 25 [AC_LANG_PROGRAM([[
@@ -33,7 +34,7 @@ AC_DEFUN([gl_SOCKETLIB],
33 ], 34 ],
34 [gl_cv_func_wsastartup=yes], 35 [gl_cv_func_wsastartup=yes],
35 [gl_cv_func_wsastartup=no]) 36 [gl_cv_func_wsastartup=no])
36 LIBS="$gl_save_LIBS" 37 LIBS="$gl_saved_LIBS"
37 ]) 38 ])
38 if test "$gl_cv_func_wsastartup" = "yes"; then 39 if test "$gl_cv_func_wsastartup" = "yes"; then
39 AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.]) 40 AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
@@ -56,8 +57,8 @@ AC_DEFUN([gl_SOCKETLIB],
56#endif 57#endif
57char setsockopt();]], [[setsockopt();]])], 58char setsockopt();]], [[setsockopt();]])],
58 [], 59 [],
59 [gl_save_LIBS="$LIBS" 60 [gl_saved_LIBS="$LIBS"
60 LIBS="$gl_save_LIBS -lsocket" 61 LIBS="$gl_saved_LIBS -lsocket"
61 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern 62 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
62#ifdef __cplusplus 63#ifdef __cplusplus
63"C" 64"C"
@@ -65,7 +66,7 @@ char setsockopt();]], [[setsockopt();]])],
65char setsockopt();]], [[setsockopt();]])], 66char setsockopt();]], [[setsockopt();]])],
66 [gl_cv_lib_socket="-lsocket"]) 67 [gl_cv_lib_socket="-lsocket"])
67 if test -z "$gl_cv_lib_socket"; then 68 if test -z "$gl_cv_lib_socket"; then
68 LIBS="$gl_save_LIBS -lnetwork" 69 LIBS="$gl_saved_LIBS -lnetwork"
69 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern 70 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
70#ifdef __cplusplus 71#ifdef __cplusplus
71"C" 72"C"
@@ -73,7 +74,7 @@ char setsockopt();]], [[setsockopt();]])],
73char setsockopt();]], [[setsockopt();]])], 74char setsockopt();]], [[setsockopt();]])],
74 [gl_cv_lib_socket="-lnetwork"]) 75 [gl_cv_lib_socket="-lnetwork"])
75 if test -z "$gl_cv_lib_socket"; then 76 if test -z "$gl_cv_lib_socket"; then
76 LIBS="$gl_save_LIBS -lnet" 77 LIBS="$gl_saved_LIBS -lnet"
77 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern 78 AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
78#ifdef __cplusplus 79#ifdef __cplusplus
79"C" 80"C"
@@ -82,7 +83,7 @@ char setsockopt();]], [[setsockopt();]])],
82 [gl_cv_lib_socket="-lnet"]) 83 [gl_cv_lib_socket="-lnet"])
83 fi 84 fi
84 fi 85 fi
85 LIBS="$gl_save_LIBS" 86 LIBS="$gl_saved_LIBS"
86 ]) 87 ])
87 if test -z "$gl_cv_lib_socket"; then 88 if test -z "$gl_cv_lib_socket"; then
88 gl_cv_lib_socket="none needed" 89 gl_cv_lib_socket="none needed"
diff --git a/gl/m4/sockets.m4 b/gl/m4/sockets.m4
index ed9cb873..a3dfe92f 100644
--- a/gl/m4/sockets.m4
+++ b/gl/m4/sockets.m4
@@ -1,5 +1,6 @@
1# sockets.m4 serial 7 1# sockets.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 7
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/socklen.m4 b/gl/m4/socklen.m4
index 1c63a853..9ece0abb 100644
--- a/gl/m4/socklen.m4
+++ b/gl/m4/socklen.m4
@@ -1,5 +1,6 @@
1# socklen.m4 serial 11 1# socklen.m4
2dnl Copyright (C) 2005-2007, 2009-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2005-2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sockpfaf.m4 b/gl/m4/sockpfaf.m4
index 6c6dc2f7..c68b3abb 100644
--- a/gl/m4/sockpfaf.m4
+++ b/gl/m4/sockpfaf.m4
@@ -1,5 +1,6 @@
1# sockpfaf.m4 serial 10 1# sockpfaf.m4
2dnl Copyright (C) 2004, 2006, 2009-2023 Free Software Foundation, Inc. 2# serial 10
3dnl Copyright (C) 2004, 2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/ssize_t.m4 b/gl/m4/ssize_t.m4
index 1c12c33e..c15f948a 100644
--- a/gl/m4/ssize_t.m4
+++ b/gl/m4/ssize_t.m4
@@ -1,23 +1,38 @@
1# ssize_t.m4 serial 5 (gettext-0.18.2) 1# ssize_t.m4
2dnl Copyright (C) 2001-2003, 2006, 2010-2023 Free Software Foundation, Inc. 2# serial 6
3dnl Copyright (C) 2001-2003, 2006, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6 7
7dnl From Bruno Haible. 8dnl From Bruno Haible.
8dnl Test whether ssize_t is defined. 9dnl Define ssize_t if it does not already exist.
9 10
10AC_DEFUN([gt_TYPE_SSIZE_T], 11AC_DEFUN([gt_TYPE_SSIZE_T],
11[ 12[
12 AC_CACHE_CHECK([for ssize_t], [gt_cv_ssize_t], 13 AC_CACHE_CHECK([for ssize_t], [gl_cv_ssize_t],
13 [AC_COMPILE_IFELSE( 14 [AC_COMPILE_IFELSE(
14 [AC_LANG_PROGRAM( 15 [AC_LANG_PROGRAM(
15 [[#include <sys/types.h>]], 16 [[#include <sys/types.h>]],
16 [[int x = sizeof (ssize_t *) + sizeof (ssize_t); 17 [[int x = sizeof (ssize_t *) + sizeof (ssize_t);
17 return !x;]])], 18 return !x;]])],
18 [gt_cv_ssize_t=yes], [gt_cv_ssize_t=no])]) 19 [gl_cv_ssize_t=yes], [gl_cv_ssize_t=no])])
19 if test $gt_cv_ssize_t = no; then 20 if test $gl_cv_ssize_t = no; then
20 AC_DEFINE([ssize_t], [int], 21 dnl On 64-bit native Windows, ssize_t needs to be defined as 'long long',
21 [Define as a signed type of the same size as size_t.]) 22 dnl for consistency with the 64-bit size_t.
23 AC_CACHE_CHECK([whether size_t is wider than 'long'], [gl_cv_size_t_large],
24 [AC_COMPILE_IFELSE(
25 [AC_LANG_PROGRAM(
26 [[#include <sys/types.h>
27 typedef int array [2 * (sizeof (size_t) > sizeof (long)) - 1];
28 ]])],
29 [gl_cv_size_t_large=yes], [gl_cv_size_t_large=no])])
30 if test $gl_cv_size_t_large = yes; then
31 gl_def_ssize_t='long long'
32 else
33 gl_def_ssize_t='long'
34 fi
35 AC_DEFINE_UNQUOTED([ssize_t], [$gl_def_ssize_t],
36 [Define as a signed type of the same size as size_t.])
22 fi 37 fi
23]) 38])
diff --git a/gl/m4/stat-time.m4 b/gl/m4/stat-time.m4
index 40993d57..e8ee7d51 100644
--- a/gl/m4/stat-time.m4
+++ b/gl/m4/stat-time.m4
@@ -1,11 +1,11 @@
1# Checks for stat-related time functions. 1# stat-time.m4
2 2# serial 1
3# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2023 Free Software 3dnl Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2024 Free Software Foundation, Inc.
4# Foundation, Inc. 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
5 7
6# This file is free software; the Free Software Foundation 8# Checks for stat-related time functions.
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9 9
10dnl From Paul Eggert. 10dnl From Paul Eggert.
11 11
diff --git a/gl/m4/stat.m4 b/gl/m4/stat.m4
index 4d241e27..fabd360c 100644
--- a/gl/m4/stat.m4
+++ b/gl/m4/stat.m4
@@ -1,10 +1,9 @@
1# serial 18 1# stat.m4
2 2# serial 21
3# Copyright (C) 2009-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
4# 4dnl This file is free software; the Free Software Foundation
5# This file is free software; the Free Software Foundation 5dnl gives unlimited permission to copy and/or distribute it,
6# gives unlimited permission to copy and/or distribute it, 6dnl with or without modifications, as long as this notice is preserved.
7# with or without modifications, as long as this notice is preserved.
8 7
9AC_DEFUN([gl_FUNC_STAT], 8AC_DEFUN([gl_FUNC_STAT],
10[ 9[
@@ -12,7 +11,7 @@ AC_DEFUN([gl_FUNC_STAT],
12 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS]) 11 AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
13 AC_CHECK_FUNCS_ONCE([lstat]) 12 AC_CHECK_FUNCS_ONCE([lstat])
14 case "$host_os" in 13 case "$host_os" in
15 mingw*) 14 mingw* | windows*)
16 dnl On this platform, the original stat() returns st_atime, st_mtime, 15 dnl On this platform, the original stat() returns st_atime, st_mtime,
17 dnl st_ctime values that are affected by the time zone. 16 dnl st_ctime values that are affected by the time zone.
18 REPLACE_STAT=1 17 REPLACE_STAT=1
@@ -45,6 +44,8 @@ AC_DEFUN([gl_FUNC_STAT],
45 [case "$host_os" in 44 [case "$host_os" in
46 # Guess yes on Linux systems. 45 # Guess yes on Linux systems.
47 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;; 46 linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
47 # Guess yes on systems that emulate the Linux system calls.
48 midipix*) gl_cv_func_stat_file_slash="guessing yes" ;;
48 # Guess yes on glibc systems. 49 # Guess yes on glibc systems.
49 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;; 50 *-gnu* | gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
50 # If we don't know, obey --enable-cross-guesses. 51 # If we don't know, obey --enable-cross-guesses.
@@ -59,8 +60,8 @@ AC_DEFUN([gl_FUNC_STAT],
59 help when passed a file name with a trailing slash]);; 60 help when passed a file name with a trailing slash]);;
60 esac 61 esac
61 case $host_os in 62 case $host_os in
62 dnl Solaris stat can return a negative tv_nsec. 63 dnl macOS and Solaris stat can return a negative tv_nsec.
63 solaris*) 64 darwin* | solaris*)
64 REPLACE_FSTAT=1 ;; 65 REPLACE_FSTAT=1 ;;
65 esac 66 esac
66 ;; 67 ;;
@@ -78,7 +79,7 @@ AC_DEFUN([gl_PREREQ_STAT], [
78AC_DEFUN([gl_PREREQ_STAT_W32], [ 79AC_DEFUN([gl_PREREQ_STAT_W32], [
79 AC_REQUIRE([AC_CANONICAL_HOST]) 80 AC_REQUIRE([AC_CANONICAL_HOST])
80 case "$host_os" in 81 case "$host_os" in
81 mingw*) 82 mingw* | windows*)
82 AC_CHECK_HEADERS([sdkddkver.h]) 83 AC_CHECK_HEADERS([sdkddkver.h])
83 ;; 84 ;;
84 esac 85 esac
diff --git a/gl/m4/std-gnu11.m4 b/gl/m4/std-gnu11.m4
index 4179470e..37324c15 100644
--- a/gl/m4/std-gnu11.m4
+++ b/gl/m4/std-gnu11.m4
@@ -1,3 +1,6 @@
1# std-gnu11.m4
2# serial 1
3
1# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*- 4# Prefer GNU C11 and C++11 to earlier versions. -*- coding: utf-8 -*-
2 5
3# This implementation is taken from GNU Autoconf lib/autoconf/c.m4 6# This implementation is taken from GNU Autoconf lib/autoconf/c.m4
@@ -9,7 +12,7 @@
9m4_version_prereq([2.70], [], [ 12m4_version_prereq([2.70], [], [
10 13
11 14
12# Copyright (C) 2001-2023 Free Software Foundation, Inc. 15# Copyright (C) 2001-2024 Free Software Foundation, Inc.
13 16
14# This program is free software; you can redistribute it and/or modify 17# This program is free software; you can redistribute it and/or modify
15# it under the terms of the GNU General Public License as published by 18# it under the terms of the GNU General Public License as published by
diff --git a/gl/m4/stdalign.m4 b/gl/m4/stdalign.m4
index dc297175..2b4762f3 100644
--- a/gl/m4/stdalign.m4
+++ b/gl/m4/stdalign.m4
@@ -1,20 +1,24 @@
1# Check for alignas and alignof that conform to C23. 1# stdalign.m4
2 2# serial 1
3dnl Copyright 2011-2023 Free Software Foundation, Inc. 3dnl Copyright 2011-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# Check for alignas and alignof that conform to C23.
9
10dnl Written by Paul Eggert and Bruno Haible.
11
8# Prepare for substituting <stdalign.h> if it is not supported. 12# Prepare for substituting <stdalign.h> if it is not supported.
9 13
10AC_DEFUN([gl_STDALIGN_H], 14AC_DEFUN([gl_ALIGNASOF],
11[ 15[
12 AC_CACHE_CHECK([for alignas and alignof], 16 AC_CACHE_CHECK([for alignas and alignof],
13 [gl_cv_header_working_stdalign_h], 17 [gl_cv_header_working_stdalign_h],
14 [gl_save_CFLAGS=$CFLAGS 18 [gl_saved_CFLAGS=$CFLAGS
15 for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do 19 for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
16 AS_CASE([$gl_working], 20 AS_CASE([$gl_working],
17 [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"]) 21 [*stdalign.h*], [CFLAGS="$gl_saved_CFLAGS -DINCLUDE_STDALIGN_H"])
18 AC_COMPILE_IFELSE( 22 AC_COMPILE_IFELSE(
19 [AC_LANG_PROGRAM( 23 [AC_LANG_PROGRAM(
20 [[#include <stdint.h> 24 [[#include <stdint.h>
@@ -54,85 +58,151 @@ AC_DEFUN([gl_STDALIGN_H],
54 [gl_cv_header_working_stdalign_h=$gl_working], 58 [gl_cv_header_working_stdalign_h=$gl_working],
55 [gl_cv_header_working_stdalign_h=no]) 59 [gl_cv_header_working_stdalign_h=no])
56 60
57 CFLAGS=$gl_save_CFLAGS 61 CFLAGS=$gl_saved_CFLAGS
58 test "$gl_cv_header_working_stdalign_h" != no && break 62 test "$gl_cv_header_working_stdalign_h" != no && break
59 done]) 63 done])
60 64
61 GL_GENERATE_STDALIGN_H=false
62 AS_CASE([$gl_cv_header_working_stdalign_h], 65 AS_CASE([$gl_cv_header_working_stdalign_h],
63 [no],
64 [GL_GENERATE_STDALIGN_H=true],
65 [yes*keyword*], 66 [yes*keyword*],
66 [AC_DEFINE([HAVE_C_ALIGNASOF], [1], 67 [AC_DEFINE([HAVE_C_ALIGNASOF], [1],
67 [Define to 1 if the alignas and alignof keywords work.])]) 68 [Define to 1 if the alignas and alignof keywords work.])])
68 69
69 AC_CHECK_HEADERS_ONCE([stdalign.h])
70
71 dnl The "zz" puts this toward config.h's end, to avoid potential 70 dnl The "zz" puts this toward config.h's end, to avoid potential
72 dnl collisions with other definitions. 71 dnl collisions with other definitions.
73 AH_VERBATIM([zzalignas], 72 AH_VERBATIM([zzalignas],
74[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof 73[#if !defined HAVE_C_ALIGNASOF \
75# if HAVE_STDALIGN_H 74 && !(defined __cplusplus && 201103 <= __cplusplus) \
75 && !defined alignof
76# if defined HAVE_STDALIGN_H
76# include <stdalign.h> 77# include <stdalign.h>
77# else 78# endif
78 /* Substitute. Keep consistent with gnulib/lib/stdalign.in.h. */ 79
79# ifndef _GL_STDALIGN_H 80/* ISO C23 alignas and alignof for platforms that lack it.
80# define _GL_STDALIGN_H 81
81# undef _Alignas 82 References:
82# undef _Alignof 83 ISO C23 (latest free draft
83# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \ 84 <http://www.open-std.org/jtc1/sc22/wg14/www/docs/n3047.pdf>)
84 || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \ 85 sections 6.5.3.4, 6.7.5, 7.15.
85 && !defined __clang__) \ 86 C++11 (latest free draft
86 || (defined __clang__ && __clang_major__ < 8)) 87 <http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf>)
87# ifdef __cplusplus 88 section 18.10. */
88# if (201103 <= __cplusplus || defined _MSC_VER) 89
89# define _Alignof(type) alignof (type) 90/* alignof (TYPE), also known as _Alignof (TYPE), yields the alignment
90# else 91 requirement of a structure member (i.e., slot or field) that is of
91 template <class __t> struct __alignof_helper { char __a; __t __b; }; 92 type TYPE, as an integer constant expression.
92# define _Alignof(type) offsetof (__alignof_helper<type>, __b) 93
93# define _GL_STDALIGN_NEEDS_STDDEF 1 94 This differs from GCC's and clang's __alignof__ operator, which can
94# endif 95 yield a better-performing alignment for an object of that type. For
96 example, on x86 with GCC and on Linux/x86 with clang,
97 __alignof__ (double) and __alignof__ (long long) are 8, whereas
98 alignof (double) and alignof (long long) are 4 unless the option
99 '-malign-double' is used.
100
101 The result cannot be used as a value for an 'enum' constant, if you
102 want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc. */
103
104/* GCC releases before GCC 4.9 had a bug in _Alignof. See GCC bug 52023
105 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
106 clang versions < 8.0.0 have the same bug. */
107# if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
108 || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
109 && !defined __clang__) \
110 || (defined __clang__ && __clang_major__ < 8))
111# undef/**/_Alignof
112# ifdef __cplusplus
113# if (201103 <= __cplusplus || defined _MSC_VER)
114# define _Alignof(type) alignof (type)
95# else 115# else
116 template <class __t> struct __alignof_helper { char __a; __t __b; };
96# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__ 117# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
97# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b) 118# define _Alignof(type) __builtin_offsetof (__alignof_helper<type>, __b)
98# else 119# else
99# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b) 120# define _Alignof(type) offsetof (__alignof_helper<type>, __b)
100# define _GL_STDALIGN_NEEDS_STDDEF 1
101# endif 121# endif
122# define _GL_STDALIGN_NEEDS_STDDEF 1
102# endif 123# endif
103# endif 124# else
104# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)) 125# if (defined __GNUC__ && 4 <= __GNUC__) || defined __clang__
105# define alignof _Alignof 126# define _Alignof(type) __builtin_offsetof (struct { char __a; type __b; }, __b)
106# endif 127# else
107# define __alignof_is_defined 1 128# define _Alignof(type) offsetof (struct { char __a; type __b; }, __b)
108# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 129# define _GL_STDALIGN_NEEDS_STDDEF 1
109# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
110# define _Alignas(a) alignas (a)
111# elif (!defined __attribute__ \
112 && ((defined __APPLE__ && defined __MACH__ \
113 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
114 : __GNUC__ && !defined __ibmxl__) \
115 || (4 <= __clang_major__) \
116 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
117 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
118# define _Alignas(a) __attribute__ ((__aligned__ (a)))
119# elif 1300 <= _MSC_VER
120# define _Alignas(a) __declspec (align (a))
121# endif 130# endif
122# endif 131# endif
123# if ((defined _Alignas \ 132# endif
124 && !(defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) \ 133# if ! (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))
125 || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) 134# undef/**/alignof
126# define alignas _Alignas 135# define alignof _Alignof
127# endif 136# endif
128# if (defined alignas \ 137
129 || (defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER))) 138/* alignas (A), also known as _Alignas (A), aligns a variable or type
130# define __alignas_is_defined 1 139 to the alignment A, where A is an integer constant expression. For
131# endif 140 example:
132# if _GL_STDALIGN_NEEDS_STDDEF 141
133# include <stddef.h> 142 int alignas (8) foo;
134# endif 143 struct s { int a; int alignas (8) bar; };
135# endif /* _GL_STDALIGN_H */ 144
145 aligns the address of FOO and the offset of BAR to be multiples of 8.
146
147 A should be a power of two that is at least the type's alignment
148 and at most the implementation's alignment limit. This limit is
149 2**28 on typical GNUish hosts, and 2**13 on MSVC. To be portable
150 to MSVC through at least version 10.0, A should be an integer
151 constant, as MSVC does not support expressions such as 1 << 3.
152 To be portable to Sun C 5.11, do not align auto variables to
153 anything stricter than their default alignment.
154
155 The following C23 requirements are not supported here:
156
157 - If A is zero, alignas has no effect.
158 - alignas can be used multiple times; the strictest one wins.
159 - alignas (TYPE) is equivalent to alignas (alignof (TYPE)).
160
161 */
162# if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
163# if defined __cplusplus && (201103 <= __cplusplus || defined _MSC_VER)
164# define _Alignas(a) alignas (a)
165# elif (!defined __attribute__ \
166 && ((defined __APPLE__ && defined __MACH__ \
167 ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
168 : __GNUC__ && !defined __ibmxl__) \
169 || (4 <= __clang_major__) \
170 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
171 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
172# define _Alignas(a) __attribute__ ((__aligned__ (a)))
173# elif 1300 <= _MSC_VER
174# define _Alignas(a) __declspec (align (a))
175# endif
176# endif
177# if !defined HAVE_STDALIGN_H
178# if ((defined _Alignas \
179 && !(defined __cplusplus \
180 && (201103 <= __cplusplus || defined _MSC_VER))) \
181 || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
182# define alignas _Alignas
183# endif
184# endif
185
186# if defined _GL_STDALIGN_NEEDS_STDDEF
187# include <stddef.h>
136# endif 188# endif
137#endif]) 189#endif])
138]) 190])
191
192AC_DEFUN([gl_STDALIGN_H],
193[
194 AC_REQUIRE([gl_ALIGNASOF])
195 if test "$gl_cv_header_working_stdalign_h" = no; then
196 GL_GENERATE_STDALIGN_H=true
197 else
198 GL_GENERATE_STDALIGN_H=false
199 fi
200
201 gl_CHECK_NEXT_HEADERS([stdalign.h])
202 if test $ac_cv_header_stdalign_h = yes; then
203 HAVE_STDALIGN_H=1
204 else
205 HAVE_STDALIGN_H=0
206 fi
207 AC_SUBST([HAVE_STDALIGN_H])
208])
diff --git a/gl/m4/stddef_h.m4 b/gl/m4/stddef_h.m4
index a2322ebb..84d3bae8 100644
--- a/gl/m4/stddef_h.m4
+++ b/gl/m4/stddef_h.m4
@@ -1,5 +1,6 @@
1# stddef_h.m4 serial 13 1# stddef_h.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 14
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -68,6 +69,21 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
68 GL_GENERATE_STDDEF_H=true 69 GL_GENERATE_STDDEF_H=true
69 fi 70 fi
70 71
72 AC_CACHE_CHECK([for unreachable],
73 [gl_cv_func_unreachable],
74 [AC_LINK_IFELSE(
75 [AC_LANG_PROGRAM(
76 [[#include <stddef.h>
77 ]],
78 [[unreachable ();
79 ]])],
80 [gl_cv_func_unreachable=yes],
81 [gl_cv_func_unreachable=no])
82 ])
83 if test $gl_cv_func_unreachable = no; then
84 GL_GENERATE_STDDEF_H=true
85 fi
86
71 if $GL_GENERATE_STDDEF_H; then 87 if $GL_GENERATE_STDDEF_H; then
72 gl_NEXT_HEADERS([stddef.h]) 88 gl_NEXT_HEADERS([stddef.h])
73 fi 89 fi
diff --git a/gl/m4/stdint.m4 b/gl/m4/stdint.m4
index d6961b09..2dea8469 100644
--- a/gl/m4/stdint.m4
+++ b/gl/m4/stdint.m4
@@ -1,5 +1,6 @@
1# stdint.m4 serial 61 1# stdint.m4
2dnl Copyright (C) 2001-2023 Free Software Foundation, Inc. 2# serial 63
3dnl Copyright (C) 2001-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -150,7 +151,10 @@ intmax_t i = INTMAX_MAX;
150uintmax_t j = UINTMAX_MAX; 151uintmax_t j = UINTMAX_MAX;
151 152
152/* Check that SIZE_MAX has the correct type, if possible. */ 153/* Check that SIZE_MAX has the correct type, if possible. */
153#if 201112 <= __STDC_VERSION__ 154/* ISO C 11 mandates _Generic, but GCC versions < 4.9 lack it. */
155#if 201112 <= __STDC_VERSION__ \
156 && (!defined __GNUC__ || 4 < __GNUC__ + (9 <= __GNUC_MINOR__) \
157 || defined __clang__)
154int k = _Generic (SIZE_MAX, size_t: 0); 158int k = _Generic (SIZE_MAX, size_t: 0);
155#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \ 159#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
156 || (0x5110 <= __SUNPRO_C && !__STDC__)) 160 || (0x5110 <= __SUNPRO_C && !__STDC__))
@@ -283,10 +287,10 @@ static const char *macro_values[] =
283 [gl_cv_header_working_stdint_h=yes], 287 [gl_cv_header_working_stdint_h=yes],
284 [], 288 [],
285 [case "$host_os" in 289 [case "$host_os" in
286 # Guess yes on native Windows. 290 # Guess yes on native Windows.
287 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;; 291 mingw* | windows*) gl_cv_header_working_stdint_h="guessing yes" ;;
288 # In general, assume it works. 292 # In general, assume it works.
289 *) gl_cv_header_working_stdint_h="guessing yes" ;; 293 *) gl_cv_header_working_stdint_h="guessing yes" ;;
290 esac 294 esac
291 ]) 295 ])
292 ]) 296 ])
diff --git a/gl/m4/stdint_h.m4 b/gl/m4/stdint_h.m4
index 70349f6c..29f42160 100644
--- a/gl/m4/stdint_h.m4
+++ b/gl/m4/stdint_h.m4
@@ -1,5 +1,6 @@
1# stdint_h.m4 serial 9 1# stdint_h.m4
2dnl Copyright (C) 1997-2004, 2006, 2008-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 1997-2004, 2006, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/stdio_h.m4 b/gl/m4/stdio_h.m4
index 94271e11..8eb5816a 100644
--- a/gl/m4/stdio_h.m4
+++ b/gl/m4/stdio_h.m4
@@ -1,12 +1,23 @@
1# stdio_h.m4 serial 59 1# stdio_h.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 63
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
6 7
7AC_DEFUN_ONCE([gl_STDIO_H], 8AC_DEFUN([gl_STDIO_H_EARLY],
8[ 9[
9 AC_REQUIRE([gl_STDIO_H_DEFAULTS]) 10 dnl Defining __USE_MINGW_ANSI_STDIO to 1 must be done early, because
11 dnl the results of several configure tests depend on it: The tests
12 dnl - checking whether snprintf returns a byte count as in C99...
13 dnl - checking whether snprintf truncates the result as in C99...
14 dnl - checking whether printf supports the 'F' directive...
15 dnl - checking whether printf supports the grouping flag...
16 dnl - checking whether printf supports the zero flag correctly...
17 dnl - checking whether printf supports infinite 'double' arguments...
18 dnl - checking whether printf supports large precisions...
19 dnl report 'yes' if __USE_MINGW_ANSI_STDIO is 1 but 'no' if
20 dnl __USE_MINGW_ANSI_STDIO is not set.
10 AH_VERBATIM([MINGW_ANSI_STDIO], 21 AH_VERBATIM([MINGW_ANSI_STDIO],
11[/* Use GNU style printf and scanf. */ 22[/* Use GNU style printf and scanf. */
12#ifndef __USE_MINGW_ANSI_STDIO 23#ifndef __USE_MINGW_ANSI_STDIO
@@ -14,6 +25,11 @@ AC_DEFUN_ONCE([gl_STDIO_H],
14#endif 25#endif
15]) 26])
16 AC_DEFINE([__USE_MINGW_ANSI_STDIO]) 27 AC_DEFINE([__USE_MINGW_ANSI_STDIO])
28])
29
30AC_DEFUN_ONCE([gl_STDIO_H],
31[
32 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
17 gl_NEXT_HEADERS([stdio.h]) 33 gl_NEXT_HEADERS([stdio.h])
18 34
19 dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and 35 dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
@@ -40,6 +56,9 @@ AC_DEFUN_ONCE([gl_STDIO_H],
40 attribute "__gnu_printf__" instead of "__printf__"]) 56 attribute "__gnu_printf__" instead of "__printf__"])
41 fi 57 fi
42 58
59 dnl For defining _PRINTF_NAN_LEN_MAX.
60 gl_MUSL_LIBC
61
43 dnl This ifdef is an optimization, to avoid performing a configure check whose 62 dnl This ifdef is an optimization, to avoid performing a configure check whose
44 dnl result is not used. But it does not make the test of 63 dnl result is not used. But it does not make the test of
45 dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant. 64 dnl GNULIB_STDIO_H_NONBLOCKING or GNULIB_NONBLOCKING redundant.
@@ -82,6 +101,16 @@ AC_DEFUN_ONCE([gl_STDIO_H],
82 if test $ac_cv_have_decl_fcloseall = no; then 101 if test $ac_cv_have_decl_fcloseall = no; then
83 HAVE_DECL_FCLOSEALL=0 102 HAVE_DECL_FCLOSEALL=0
84 fi 103 fi
104
105 AC_CHECK_DECLS_ONCE([getw])
106 if test $ac_cv_have_decl_getw = no; then
107 HAVE_DECL_GETW=0
108 fi
109
110 AC_CHECK_DECLS_ONCE([putw])
111 if test $ac_cv_have_decl_putw = no; then
112 HAVE_DECL_PUTW=0
113 fi
85]) 114])
86 115
87# gl_STDIO_MODULE_INDICATOR([modulename]) 116# gl_STDIO_MODULE_INDICATOR([modulename])
@@ -178,7 +207,9 @@ AC_DEFUN([gl_STDIO_H_DEFAULTS],
178 HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO]) 207 HAVE_DECL_FTELLO=1; AC_SUBST([HAVE_DECL_FTELLO])
179 HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM]) 208 HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
180 HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE]) 209 HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
210 HAVE_DECL_GETW=1; AC_SUBST([HAVE_DECL_GETW])
181 HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF]) 211 HAVE_DECL_OBSTACK_PRINTF=1; AC_SUBST([HAVE_DECL_OBSTACK_PRINTF])
212 HAVE_DECL_PUTW=1; AC_SUBST([HAVE_DECL_PUTW])
182 HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF]) 213 HAVE_DECL_SNPRINTF=1; AC_SUBST([HAVE_DECL_SNPRINTF])
183 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF]) 214 HAVE_DECL_VSNPRINTF=1; AC_SUBST([HAVE_DECL_VSNPRINTF])
184 HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF]) 215 HAVE_DPRINTF=1; AC_SUBST([HAVE_DPRINTF])
diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4
index e96be22f..a4662f29 100644
--- a/gl/m4/stdlib_h.m4
+++ b/gl/m4/stdlib_h.m4
@@ -1,5 +1,6 @@
1# stdlib_h.m4 serial 66 1# stdlib_h.m4
2dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 2# serial 77
3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -23,15 +24,58 @@ AC_DEFUN_ONCE([gl_STDLIB_H],
23# include <random.h> 24# include <random.h>
24#endif 25#endif
25 ]], [_Exit aligned_alloc atoll canonicalize_file_name free 26 ]], [_Exit aligned_alloc atoll canonicalize_file_name free
26 getloadavg getsubopt grantpt 27 getloadavg getprogname getsubopt grantpt
27 initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps 28 initstate initstate_r mbstowcs mbtowc mkdtemp mkostemp mkostemps mkstemp
28 posix_memalign posix_openpt ptsname ptsname_r qsort_r 29 mkstemps posix_memalign posix_openpt ptsname ptsname_r qsort_r
29 random random_r reallocarray realpath rpmatch secure_getenv setenv 30 random random_r reallocarray realpath rpmatch secure_getenv setenv
30 setstate setstate_r srandom srandom_r 31 setstate setstate_r srandom srandom_r
31 strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv]) 32 strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv])
32 33
33 AC_REQUIRE([AC_C_RESTRICT]) 34 AC_REQUIRE([AC_C_RESTRICT])
34 35
36 dnl Test whether MB_CUR_MAX needs to be overridden.
37 dnl On Solaris 10, in UTF-8 locales, its value is 3 but needs to be 4.
38 dnl Fortunately, we can do this because on this platform MB_LEN_MAX is 5.
39 AC_REQUIRE([AC_CANONICAL_HOST])
40 AC_REQUIRE([gt_LOCALE_FR_UTF8])
41 AC_CACHE_CHECK([whether MB_CUR_MAX is correct],
42 [gl_cv_macro_MB_CUR_MAX_good],
43 [
44 dnl Initial guess, used when cross-compiling or when no suitable locale
45 dnl is present.
46changequote(,)dnl
47 case "$host_os" in
48 # Guess no on Solaris.
49 solaris*) gl_cv_macro_MB_CUR_MAX_good="guessing no" ;;
50 # Guess yes otherwise.
51 *) gl_cv_macro_MB_CUR_MAX_good="guessing yes" ;;
52 esac
53changequote([,])dnl
54 if test $LOCALE_FR_UTF8 != none; then
55 AC_RUN_IFELSE(
56 [AC_LANG_SOURCE([[
57#include <locale.h>
58#include <stdlib.h>
59int main ()
60{
61 int result = 0;
62 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
63 {
64 if (MB_CUR_MAX < 4)
65 result |= 1;
66 }
67 return result;
68}]])],
69 [gl_cv_macro_MB_CUR_MAX_good=yes],
70 [gl_cv_macro_MB_CUR_MAX_good=no],
71 [:])
72 fi
73 ])
74 case "$gl_cv_macro_MB_CUR_MAX_good" in
75 *yes) ;;
76 *) REPLACE_MB_CUR_MAX=1 ;;
77 esac
78
35 AC_CHECK_DECLS_ONCE([ecvt]) 79 AC_CHECK_DECLS_ONCE([ecvt])
36 if test $ac_cv_have_decl_ecvt = no; then 80 if test $ac_cv_have_decl_ecvt = no; then
37 HAVE_DECL_ECVT=0 81 HAVE_DECL_ECVT=0
@@ -73,10 +117,12 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
73 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME]) 117 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME])
74 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX]) 118 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX])
75 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG]) 119 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
120 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPROGNAME])
76 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT]) 121 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT])
77 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT]) 122 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT])
78 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU]) 123 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_GNU])
79 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX]) 124 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX])
125 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOWCS])
80 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC]) 126 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC])
81 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP]) 127 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP])
82 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP]) 128 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP])
@@ -89,6 +135,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
89 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R]) 135 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
90 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV]) 136 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
91 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R]) 137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAND])
92 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM]) 139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
93 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R]) 140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
94 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY]) 141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
@@ -99,6 +146,7 @@ AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
99 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV]) 146 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
100 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV]) 147 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
101 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD]) 148 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
149 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOF])
102 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL]) 150 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
103 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD]) 151 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
104 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL]) 152 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
@@ -130,6 +178,8 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
130 HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT]) 178 HAVE_DECL_FCVT=1; AC_SUBST([HAVE_DECL_FCVT])
131 HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT]) 179 HAVE_DECL_GCVT=1; AC_SUBST([HAVE_DECL_GCVT])
132 HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG]) 180 HAVE_DECL_GETLOADAVG=1; AC_SUBST([HAVE_DECL_GETLOADAVG])
181 HAVE_DECL_PROGRAM_INVOCATION_NAME=1; AC_SUBST([HAVE_DECL_PROGRAM_INVOCATION_NAME])
182 HAVE_GETPROGNAME=1; AC_SUBST([HAVE_GETPROGNAME])
133 HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT]) 183 HAVE_GETSUBOPT=1; AC_SUBST([HAVE_GETSUBOPT])
134 HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT]) 184 HAVE_GRANTPT=1; AC_SUBST([HAVE_GRANTPT])
135 HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE]) 185 HAVE_INITSTATE=1; AC_SUBST([HAVE_INITSTATE])
@@ -157,6 +207,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
157 HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE]) 207 HAVE_SETSTATE=1; AC_SUBST([HAVE_SETSTATE])
158 HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE]) 208 HAVE_DECL_SETSTATE=1; AC_SUBST([HAVE_DECL_SETSTATE])
159 HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD]) 209 HAVE_STRTOD=1; AC_SUBST([HAVE_STRTOD])
210 HAVE_STRTOF=1; AC_SUBST([HAVE_STRTOF])
160 HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL]) 211 HAVE_STRTOL=1; AC_SUBST([HAVE_STRTOL])
161 HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD]) 212 HAVE_STRTOLD=1; AC_SUBST([HAVE_STRTOLD])
162 HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL]) 213 HAVE_STRTOLL=1; AC_SUBST([HAVE_STRTOLL])
@@ -166,21 +217,31 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
166 HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H]) 217 HAVE_SYS_LOADAVG_H=0; AC_SUBST([HAVE_SYS_LOADAVG_H])
167 HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT]) 218 HAVE_UNLOCKPT=1; AC_SUBST([HAVE_UNLOCKPT])
168 HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV]) 219 HAVE_DECL_UNSETENV=1; AC_SUBST([HAVE_DECL_UNSETENV])
220 REPLACE__EXIT=0; AC_SUBST([REPLACE__EXIT])
169 REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC]) 221 REPLACE_ALIGNED_ALLOC=0; AC_SUBST([REPLACE_ALIGNED_ALLOC])
170 REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU]) 222 REPLACE_CALLOC_FOR_CALLOC_GNU=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_GNU])
171 REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX]) 223 REPLACE_CALLOC_FOR_CALLOC_POSIX=0; AC_SUBST([REPLACE_CALLOC_FOR_CALLOC_POSIX])
172 REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME]) 224 REPLACE_CANONICALIZE_FILE_NAME=0; AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
173 REPLACE_FREE=0; AC_SUBST([REPLACE_FREE]) 225 REPLACE_FREE=0; AC_SUBST([REPLACE_FREE])
226 REPLACE_GETLOADAVG=0; AC_SUBST([REPLACE_GETLOADAVG])
227 REPLACE_GETPROGNAME=0; AC_SUBST([REPLACE_GETPROGNAME])
228 REPLACE_GETSUBOPT=0; AC_SUBST([REPLACE_GETSUBOPT])
174 REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE]) 229 REPLACE_INITSTATE=0; AC_SUBST([REPLACE_INITSTATE])
175 REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU]) 230 REPLACE_MALLOC_FOR_MALLOC_GNU=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_GNU])
176 REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX]) 231 REPLACE_MALLOC_FOR_MALLOC_POSIX=0; AC_SUBST([REPLACE_MALLOC_FOR_MALLOC_POSIX])
232 REPLACE_MB_CUR_MAX=0; AC_SUBST([REPLACE_MB_CUR_MAX])
233 REPLACE_MBSTOWCS=0; AC_SUBST([REPLACE_MBSTOWCS])
177 REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC]) 234 REPLACE_MBTOWC=0; AC_SUBST([REPLACE_MBTOWC])
235 REPLACE_MKOSTEMP=0; AC_SUBST([REPLACE_MKOSTEMP])
236 REPLACE_MKOSTEMPS=0; AC_SUBST([REPLACE_MKOSTEMPS])
178 REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) 237 REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP])
179 REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN]) 238 REPLACE_POSIX_MEMALIGN=0; AC_SUBST([REPLACE_POSIX_MEMALIGN])
239 REPLACE_POSIX_OPENPT=0; AC_SUBST([REPLACE_POSIX_OPENPT])
180 REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME]) 240 REPLACE_PTSNAME=0; AC_SUBST([REPLACE_PTSNAME])
181 REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) 241 REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R])
182 REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) 242 REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV])
183 REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R]) 243 REPLACE_QSORT_R=0; AC_SUBST([REPLACE_QSORT_R])
244 REPLACE_RAND=0; AC_SUBST([REPLACE_RAND])
184 REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM]) 245 REPLACE_RANDOM=0; AC_SUBST([REPLACE_RANDOM])
185 REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) 246 REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R])
186 REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU]) 247 REPLACE_REALLOC_FOR_REALLOC_GNU=0; AC_SUBST([REPLACE_REALLOC_FOR_REALLOC_GNU])
@@ -190,6 +251,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
190 REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) 251 REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV])
191 REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE]) 252 REPLACE_SETSTATE=0; AC_SUBST([REPLACE_SETSTATE])
192 REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD]) 253 REPLACE_STRTOD=0; AC_SUBST([REPLACE_STRTOD])
254 REPLACE_STRTOF=0; AC_SUBST([REPLACE_STRTOF])
193 REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL]) 255 REPLACE_STRTOL=0; AC_SUBST([REPLACE_STRTOL])
194 REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD]) 256 REPLACE_STRTOLD=0; AC_SUBST([REPLACE_STRTOLD])
195 REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL]) 257 REPLACE_STRTOLL=0; AC_SUBST([REPLACE_STRTOLL])
diff --git a/gl/m4/strcase.m4 b/gl/m4/strcase.m4
index 3cf740d2..63021733 100644
--- a/gl/m4/strcase.m4
+++ b/gl/m4/strcase.m4
@@ -1,5 +1,6 @@
1# strcase.m4 serial 12 1# strcase.m4
2dnl Copyright (C) 2002, 2005-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2002, 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strcasestr.m4 b/gl/m4/strcasestr.m4
index 971e0b23..d2548716 100644
--- a/gl/m4/strcasestr.m4
+++ b/gl/m4/strcasestr.m4
@@ -1,5 +1,6 @@
1# strcasestr.m4 serial 28 1# strcasestr.m4
2dnl Copyright (C) 2005, 2007-2023 Free Software Foundation, Inc. 2# serial 28
3dnl Copyright (C) 2005, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strerror.m4 b/gl/m4/strerror.m4
index 8879eb08..0272c6f4 100644
--- a/gl/m4/strerror.m4
+++ b/gl/m4/strerror.m4
@@ -1,5 +1,6 @@
1# strerror.m4 serial 23 1# strerror.m4
2dnl Copyright (C) 2002, 2007-2023 Free Software Foundation, Inc. 2# serial 25
3dnl Copyright (C) 2002, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -24,12 +25,12 @@ AC_DEFUN([gl_FUNC_STRERROR],
24 [gl_cv_func_working_strerror=yes], 25 [gl_cv_func_working_strerror=yes],
25 [gl_cv_func_working_strerror=no], 26 [gl_cv_func_working_strerror=no],
26 [case "$host_os" in 27 [case "$host_os" in
27 # Guess yes on glibc systems. 28 # Guess yes on glibc systems.
28 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;; 29 *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
29 # Guess yes on musl systems. 30 # Guess yes on musl systems.
30 *-musl*) gl_cv_func_working_strerror="guessing yes" ;; 31 *-musl* | midipix*) gl_cv_func_working_strerror="guessing yes" ;;
31 # If we don't know, obey --enable-cross-guesses. 32 # If we don't know, obey --enable-cross-guesses.
32 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;; 33 *) gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
33 esac 34 esac
34 ]) 35 ])
35 ]) 36 ])
@@ -80,14 +81,14 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
80 [gl_cv_func_strerror_0_works=yes], 81 [gl_cv_func_strerror_0_works=yes],
81 [gl_cv_func_strerror_0_works=no], 82 [gl_cv_func_strerror_0_works=no],
82 [case "$host_os" in 83 [case "$host_os" in
83 # Guess yes on glibc systems. 84 # Guess yes on glibc systems.
84 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;; 85 *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
85 # Guess yes on musl systems. 86 # Guess yes on musl systems.
86 *-musl*) gl_cv_func_strerror_0_works="guessing yes" ;; 87 *-musl* | midipix*) gl_cv_func_strerror_0_works="guessing yes" ;;
87 # Guess yes on native Windows. 88 # Guess yes on native Windows.
88 mingw*) gl_cv_func_strerror_0_works="guessing yes" ;; 89 mingw* | windows*) gl_cv_func_strerror_0_works="guessing yes" ;;
89 # If we don't know, obey --enable-cross-guesses. 90 # If we don't know, obey --enable-cross-guesses.
90 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;; 91 *) gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
91 esac 92 esac
92 ]) 93 ])
93 ]) 94 ])
diff --git a/gl/m4/string_h.m4 b/gl/m4/string_h.m4
index 5da3cc25..f31264ae 100644
--- a/gl/m4/string_h.m4
+++ b/gl/m4/string_h.m4
@@ -1,11 +1,11 @@
1# Configure a GNU-like replacement for <string.h>. 1# string_h.m4
2 2# serial 39
3# Copyright (C) 2007-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4# This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5# gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6# with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8# serial 35 8# Configure a GNU-like replacement for <string.h>.
9 9
10# Written by Paul Eggert. 10# Written by Paul Eggert.
11 11
@@ -131,6 +131,9 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
131 REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL]) 131 REPLACE_FFSLL=0; AC_SUBST([REPLACE_FFSLL])
132 REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR]) 132 REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
133 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM]) 133 REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
134 REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
135 REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT])
136 REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
134 REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY]) 137 REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
135 REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL]) 138 REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
136 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP]) 139 REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
@@ -144,5 +147,6 @@ AC_DEFUN([gl_STRING_H_DEFAULTS],
144 REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R]) 147 REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
145 REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP]) 148 REPLACE_STRERRORNAME_NP=0; AC_SUBST([REPLACE_STRERRORNAME_NP])
146 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL]) 149 REPLACE_STRSIGNAL=0; AC_SUBST([REPLACE_STRSIGNAL])
150 REPLACE_STRVERSCMP=0; AC_SUBST([REPLACE_STRVERSCMP])
147 UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R]) 151 UNDEFINE_STRTOK_R=0; AC_SUBST([UNDEFINE_STRTOK_R])
148]) 152])
diff --git a/gl/m4/strings_h.m4 b/gl/m4/strings_h.m4
index 4c41221b..aaafb559 100644
--- a/gl/m4/strings_h.m4
+++ b/gl/m4/strings_h.m4
@@ -1,10 +1,11 @@
1# Configure a replacement for <strings.h>. 1# strings_h.m4
2# serial 9 2# serial 9
3dnl Copyright (C) 2007, 2009-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
3 7
4# Copyright (C) 2007, 2009-2023 Free Software Foundation, Inc. 8# Configure a replacement for <strings.h>.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8 9
9AC_DEFUN_ONCE([gl_STRINGS_H], 10AC_DEFUN_ONCE([gl_STRINGS_H],
10[ 11[
diff --git a/gl/m4/strsep.m4 b/gl/m4/strsep.m4
index e0da09a3..cfde87a5 100644
--- a/gl/m4/strsep.m4
+++ b/gl/m4/strsep.m4
@@ -1,5 +1,6 @@
1# strsep.m4 serial 11 1# strsep.m4
2dnl Copyright (C) 2002-2004, 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2002-2004, 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/strstr.m4 b/gl/m4/strstr.m4
index 7de203a7..957ed2e3 100644
--- a/gl/m4/strstr.m4
+++ b/gl/m4/strstr.m4
@@ -1,5 +1,6 @@
1# strstr.m4 serial 24 1# strstr.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 24
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_socket_h.m4 b/gl/m4/sys_socket_h.m4
index 98a10416..3bf3cb47 100644
--- a/gl/m4/sys_socket_h.m4
+++ b/gl/m4/sys_socket_h.m4
@@ -1,5 +1,6 @@
1# sys_socket_h.m4 serial 29 1# sys_socket_h.m4
2dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. 2# serial 29
3dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_stat_h.m4 b/gl/m4/sys_stat_h.m4
index ca57398a..3cc50ce6 100644
--- a/gl/m4/sys_stat_h.m4
+++ b/gl/m4/sys_stat_h.m4
@@ -1,5 +1,6 @@
1# sys_stat_h.m4 serial 42 -*- Autoconf -*- 1# sys_stat_h.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 42 -*- Autoconf -*-
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_types_h.m4 b/gl/m4/sys_types_h.m4
index 627671fb..00d2437b 100644
--- a/gl/m4/sys_types_h.m4
+++ b/gl/m4/sys_types_h.m4
@@ -1,5 +1,6 @@
1# sys_types_h.m4 serial 13 1# sys_types_h.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 13
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/sys_uio_h.m4 b/gl/m4/sys_uio_h.m4
index 93a65d26..a471c720 100644
--- a/gl/m4/sys_uio_h.m4
+++ b/gl/m4/sys_uio_h.m4
@@ -1,5 +1,6 @@
1# sys_uio_h.m4 serial 3 1# sys_uio_h.m4
2dnl Copyright (C) 2011-2023 Free Software Foundation, Inc. 2# serial 3
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/threadlib.m4 b/gl/m4/threadlib.m4
index b536b047..f5e81479 100644
--- a/gl/m4/threadlib.m4
+++ b/gl/m4/threadlib.m4
@@ -1,5 +1,6 @@
1# threadlib.m4 serial 32a 1# threadlib.m4
2dnl Copyright (C) 2005-2023 Free Software Foundation, Inc. 2# serial 42
3dnl Copyright (C) 2005-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -85,10 +86,11 @@ AC_DEFUN([gl_WEAK_SYMBOLS],
85 AC_CACHE_CHECK([whether imported symbols can be declared weak], 86 AC_CACHE_CHECK([whether imported symbols can be declared weak],
86 [gl_cv_have_weak], 87 [gl_cv_have_weak],
87 [case "$host_os" in 88 [case "$host_os" in
88 cygwin*) 89 cygwin* | mingw* | windows*)
89 dnl On Cygwin 3.2.0 with gcc 10.2, the test below would succeed, but 90 dnl On Cygwin 3.2.0 with gcc 10.2, and likewise on mingw 10.0.0 with
90 dnl programs that use pthread_in_use() with weak symbol references 91 dnl gcc 11.3, the test below would succeed, but programs that use
91 dnl crash miserably at runtime. 92 dnl pthread_in_use() with weak symbol references crash miserably at
93 dnl runtime.
92 gl_cv_have_weak="guessing no" 94 gl_cv_have_weak="guessing no"
93 ;; 95 ;;
94 *) 96 *)
@@ -174,7 +176,7 @@ dnl Sets the variable LIBPMULTITHREAD, for programs that really need
174dnl multithread functionality. The difference between LIBPTHREAD and 176dnl multithread functionality. The difference between LIBPTHREAD and
175dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically 177dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
176dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not. 178dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
177dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the 179dnl Sets the variable SCHED_YIELD_LIB to the linker options needed to use the
178dnl sched_yield() function. 180dnl sched_yield() function.
179dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for 181dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
180dnl multithread-safe programs. 182dnl multithread-safe programs.
@@ -205,7 +207,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
205 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04 207 # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
206 # needs -pthread for some reason. See: 208 # needs -pthread for some reason. See:
207 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html 209 # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
208 save_LIBS=$LIBS 210 saved_LIBS="$LIBS"
209 for gl_pthread in '' '-pthread'; do 211 for gl_pthread in '' '-pthread'; do
210 LIBS="$LIBS $gl_pthread" 212 LIBS="$LIBS $gl_pthread"
211 AC_LINK_IFELSE( 213 AC_LINK_IFELSE(
@@ -219,7 +221,7 @@ AC_DEFUN([gl_PTHREADLIB_BODY],
219 [gl_pthread_api=yes 221 [gl_pthread_api=yes
220 LIBPTHREAD=$gl_pthread 222 LIBPTHREAD=$gl_pthread
221 LIBPMULTITHREAD=$gl_pthread]) 223 LIBPMULTITHREAD=$gl_pthread])
222 LIBS=$save_LIBS 224 LIBS="$saved_LIBS"
223 test $gl_pthread_api = yes && break 225 test $gl_pthread_api = yes && break
224 done 226 done
225 echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD 227 echo "$as_me:__oline__: gl_pthread_api=$gl_pthread_api" >&AS_MESSAGE_LOG_FD
@@ -268,6 +270,15 @@ changequote([,])dnl
268 [Define if the pthread_in_use() detection is hard.]) 270 [Define if the pthread_in_use() detection is hard.])
269 esac 271 esac
270 fi 272 fi
273 ],
274 [dnl This is needed on FreeBSD 5.2.1.
275 AC_CHECK_LIB([thr], [pthread_kill],
276 [if test $gl_pthread_in_glibc = yes; then
277 LIBPMULTITHREAD=
278 else
279 LIBPMULTITHREAD=-lthr
280 fi
281 ])
271 ]) 282 ])
272 elif test $gl_pthread_api != yes; then 283 elif test $gl_pthread_api != yes; then
273 # Some library is needed. Try libpthread and libc_r. 284 # Some library is needed. Try libpthread and libc_r.
@@ -299,13 +310,16 @@ changequote([,])dnl
299 [AC_LANG_PROGRAM( 310 [AC_LANG_PROGRAM(
300 [[#include <sched.h>]], 311 [[#include <sched.h>]],
301 [[sched_yield ();]])], 312 [[sched_yield ();]])],
302 [LIB_SCHED_YIELD= 313 [SCHED_YIELD_LIB=
303 ], 314 ],
304 [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc. 315 [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
305 AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt], 316 AC_CHECK_LIB([rt], [sched_yield], [SCHED_YIELD_LIB=-lrt],
306 [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt. 317 [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
307 AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])]) 318 AC_CHECK_LIB([posix4], [sched_yield], [SCHED_YIELD_LIB=-lposix4])])
308 ]) 319 ])
320 AC_SUBST([SCHED_YIELD_LIB])
321 dnl For backward compatibility.
322 LIB_SCHED_YIELD="$SCHED_YIELD_LIB"
309 AC_SUBST([LIB_SCHED_YIELD]) 323 AC_SUBST([LIB_SCHED_YIELD])
310 324
311 gl_pthreadlib_body_done=done 325 gl_pthreadlib_body_done=done
@@ -340,7 +354,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
340 AC_CHECK_HEADERS_ONCE([threads.h]) 354 AC_CHECK_HEADERS_ONCE([threads.h])
341 355
342 case "$host_os" in 356 case "$host_os" in
343 mingw*) 357 mingw* | windows*)
344 LIBSTDTHREAD= 358 LIBSTDTHREAD=
345 ;; 359 ;;
346 *) 360 *)
@@ -351,7 +365,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
351 dnl on libpthread (for the symbol 'pthread_mutexattr_gettype'). 365 dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
352 dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in 366 dnl glibc >= 2.34, AIX >= 7.1, and Solaris >= 11.4 have thrd_create in
353 dnl libc. 367 dnl libc.
354 AC_CHECK_FUNCS([thrd_create]) 368 gl_CHECK_FUNCS_ANDROID([thrd_create], [[#include <threads.h>]])
355 if test $ac_cv_func_thrd_create = yes; then 369 if test $ac_cv_func_thrd_create = yes; then
356 LIBSTDTHREAD= 370 LIBSTDTHREAD=
357 else 371 else
@@ -364,7 +378,7 @@ AC_DEFUN([gl_STDTHREADLIB_BODY],
364 fi 378 fi
365 else 379 else
366 dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c. 380 dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
367 LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD" 381 LIBSTDTHREAD="$LIBPMULTITHREAD $SCHED_YIELD_LIB"
368 fi 382 fi
369 ;; 383 ;;
370 esac 384 esac
@@ -435,10 +449,12 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
435 m4_ifdef([gl_THREADLIB_DEFAULT_NO], 449 m4_ifdef([gl_THREADLIB_DEFAULT_NO],
436 [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])], 450 [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
437 [m4_divert_text([DEFAULTS], [gl_use_threads_default=])]) 451 [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
438 m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=]) 452 dnl gl_use_winpthreads_default defaults to 'no', because in mingw 10, like
453 dnl in mingw 5, the use of libwinpthread still makes test-pthread-tss crash.
454 m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=no])
439 AC_ARG_ENABLE([threads], 455 AC_ARG_ENABLE([threads],
440AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [ 456AS_HELP_STRING([[--enable-threads={isoc|posix|isoc+posix|windows}]], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
441AS_HELP_STRING([--disable-threads], [build without multithread safety])]), 457AS_HELP_STRING([[--disable-threads]], [build without multithread safety])]),
442 [gl_use_threads=$enableval], 458 [gl_use_threads=$enableval],
443 [if test -n "$gl_use_threads_default"; then 459 [if test -n "$gl_use_threads_default"; then
444 gl_use_threads="$gl_use_threads_default" 460 gl_use_threads="$gl_use_threads_default"
@@ -459,7 +475,7 @@ changequote(,)dnl
459 esac 475 esac
460 ;; 476 ;;
461 dnl Obey gl_AVOID_WINPTHREAD on mingw. 477 dnl Obey gl_AVOID_WINPTHREAD on mingw.
462 mingw*) 478 mingw* | windows*)
463 case "$gl_use_winpthreads_default" in 479 case "$gl_use_winpthreads_default" in
464 yes) gl_use_threads=posix ;; 480 yes) gl_use_threads=posix ;;
465 no) gl_use_threads=windows ;; 481 no) gl_use_threads=windows ;;
@@ -558,7 +574,7 @@ AC_DEFUN([gl_THREADLIB_BODY],
558 case "$gl_use_threads" in 574 case "$gl_use_threads" in
559 yes | windows | win32) # The 'win32' is for backward compatibility. 575 yes | windows | win32) # The 'win32' is for backward compatibility.
560 if { case "$host_os" in 576 if { case "$host_os" in
561 mingw*) true;; 577 mingw* | windows*) true;;
562 *) false;; 578 *) false;;
563 esac 579 esac
564 }; then 580 }; then
@@ -569,6 +585,10 @@ AC_DEFUN([gl_THREADLIB_BODY],
569 ;; 585 ;;
570 esac 586 esac
571 fi 587 fi
588 else
589 dnl "$gl_use_threads" is "no".
590 AC_DEFINE([AVOID_ANY_THREADS], [1],
591 [Define if no multithread safety and no multithreading is desired.])
572 fi 592 fi
573 AC_MSG_CHECKING([for multithread API to use]) 593 AC_MSG_CHECKING([for multithread API to use])
574 AC_MSG_RESULT([$gl_threads_api]) 594 AC_MSG_RESULT([$gl_threads_api])
@@ -601,7 +621,8 @@ dnl -------------------
601dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the 621dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
602dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided. 622dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
603dnl The user can still override it at installation time, by using the 623dnl The user can still override it at installation time, by using the
604dnl configure option '--enable-threads'. 624dnl configure option '--enable-threads=posix'.
625dnl As of 2023, this is now the default.
605 626
606AC_DEFUN([gl_AVOID_WINPTHREAD], [ 627AC_DEFUN([gl_AVOID_WINPTHREAD], [
607 m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no]) 628 m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
diff --git a/gl/m4/time_h.m4 b/gl/m4/time_h.m4
index f6bf3a4f..d2f3c970 100644
--- a/gl/m4/time_h.m4
+++ b/gl/m4/time_h.m4
@@ -1,12 +1,11 @@
1# Configure a more-standard replacement for <time.h>. 1# time_h.m4
2 2# serial 25
3# Copyright (C) 2000-2001, 2003-2007, 2009-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2000-2001, 2003-2007, 2009-2024 Free Software Foundation, Inc.
4 4dnl This file is free software; the Free Software Foundation
5# serial 20 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
6 7
7# This file is free software; the Free Software Foundation 8# Configure a more-standard replacement for <time.h>.
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10 9
11# Written by Paul Eggert and Jim Meyering. 10# Written by Paul Eggert and Jim Meyering.
12 11
@@ -23,7 +22,10 @@ AC_DEFUN_ONCE([gl_TIME_H],
23 dnl corresponding gnulib module is not in use. 22 dnl corresponding gnulib module is not in use.
24 gl_WARN_ON_USE_PREPARE([[ 23 gl_WARN_ON_USE_PREPARE([[
25#include <time.h> 24#include <time.h>
26 ]], [asctime_r ctime_r]) 25 ]], [
26 asctime asctime_r ctime ctime_r gmtime_r localtime localtime_r mktime
27 nanosleep strftime strptime time timegm timespec_get timespec_getres tzset
28 ])
27 29
28 AC_REQUIRE([AC_C_RESTRICT]) 30 AC_REQUIRE([AC_C_RESTRICT])
29 31
@@ -137,6 +139,7 @@ AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
137 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP]) 139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
138 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME]) 140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
139 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME]) 141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
142 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME])
140 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM]) 143 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
141 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET]) 144 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
142 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES]) 145 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GETRES])
@@ -161,23 +164,16 @@ AC_DEFUN([gl_TIME_H_DEFAULTS],
161 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES]) 164 HAVE_TIMESPEC_GETRES=1; AC_SUBST([HAVE_TIMESPEC_GETRES])
162 dnl Even GNU libc does not have timezone_t yet. 165 dnl Even GNU libc does not have timezone_t yet.
163 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T]) 166 HAVE_TIMEZONE_T=0; AC_SUBST([HAVE_TIMEZONE_T])
164 dnl If another module says to replace or to not replace, do that. 167 REPLACE_CTIME=0; AC_SUBST([REPLACE_CTIME])
165 dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
166 dnl this lets maintainers check for portability.
167 REPLACE_CTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_CTIME])
168 REPLACE_LOCALTIME_R=GNULIB_PORTCHECK; AC_SUBST([REPLACE_LOCALTIME_R])
169 REPLACE_MKTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_MKTIME])
170 REPLACE_NANOSLEEP=GNULIB_PORTCHECK; AC_SUBST([REPLACE_NANOSLEEP])
171 REPLACE_STRFTIME=GNULIB_PORTCHECK; AC_SUBST([REPLACE_STRFTIME])
172 REPLACE_TIMEGM=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TIMEGM])
173 REPLACE_TZSET=GNULIB_PORTCHECK; AC_SUBST([REPLACE_TZSET])
174
175 dnl Hack so that the time module doesn't depend on the sys_time module.
176 dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
177 : ${GNULIB_GETTIMEOFDAY=0}; AC_SUBST([GNULIB_GETTIMEOFDAY])
178 dnl Second, it's OK to not use GNULIB_PORTCHECK for REPLACE_GMTIME
179 dnl and REPLACE_LOCALTIME, as portability to Solaris 2.6 and earlier
180 dnl is no longer a big deal.
181 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME]) 168 REPLACE_GMTIME=0; AC_SUBST([REPLACE_GMTIME])
182 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME]) 169 REPLACE_LOCALTIME=0; AC_SUBST([REPLACE_LOCALTIME])
170 REPLACE_LOCALTIME_R=0; AC_SUBST([REPLACE_LOCALTIME_R])
171 REPLACE_MKTIME=0; AC_SUBST([REPLACE_MKTIME])
172 REPLACE_NANOSLEEP=0; AC_SUBST([REPLACE_NANOSLEEP])
173 REPLACE_STRFTIME=0; AC_SUBST([REPLACE_STRFTIME])
174 REPLACE_TIME=0; AC_SUBST([REPLACE_TIME])
175 REPLACE_TIMEGM=0; AC_SUBST([REPLACE_TIMEGM])
176 REPLACE_TIMESPEC_GET=0; AC_SUBST([REPLACE_TIMESPEC_GET])
177 REPLACE_TIMESPEC_GETRES=0; AC_SUBST([REPLACE_TIMESPEC_GETRES])
178 REPLACE_TZSET=0; AC_SUBST([REPLACE_TZSET])
183]) 179])
diff --git a/gl/m4/time_r.m4 b/gl/m4/time_r.m4
index adce438a..3675390e 100644
--- a/gl/m4/time_r.m4
+++ b/gl/m4/time_r.m4
@@ -1,10 +1,12 @@
1dnl Reentrant time functions: localtime_r, gmtime_r. 1# time_r.m4
2 2# serial 1
3dnl Copyright (C) 2003, 2006-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2003, 2006-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl Reentrant time functions: localtime_r, gmtime_r.
9
8dnl Written by Paul Eggert. 10dnl Written by Paul Eggert.
9 11
10AC_DEFUN([gl_TIME_R], 12AC_DEFUN([gl_TIME_R],
@@ -57,9 +59,7 @@ AC_DEFUN([gl_TIME_R],
57 [gl_cv_time_r_posix=yes], 59 [gl_cv_time_r_posix=yes],
58 [gl_cv_time_r_posix=no]) 60 [gl_cv_time_r_posix=no])
59 ]) 61 ])
60 if test $gl_cv_time_r_posix = yes; then 62 if test $gl_cv_time_r_posix != yes; then
61 REPLACE_LOCALTIME_R=0
62 else
63 REPLACE_LOCALTIME_R=1 63 REPLACE_LOCALTIME_R=1
64 fi 64 fi
65 else 65 else
diff --git a/gl/m4/timegm.m4 b/gl/m4/timegm.m4
index 6079f1a3..c1ff2677 100644
--- a/gl/m4/timegm.m4
+++ b/gl/m4/timegm.m4
@@ -1,5 +1,6 @@
1# timegm.m4 serial 13 1# timegm.m4
2dnl Copyright (C) 2003, 2007, 2009-2023 Free Software Foundation, Inc. 2# serial 16
3dnl Copyright (C) 2003, 2007, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -8,8 +9,7 @@ AC_DEFUN([gl_FUNC_TIMEGM],
8[ 9[
9 AC_REQUIRE([gl_TIME_H_DEFAULTS]) 10 AC_REQUIRE([gl_TIME_H_DEFAULTS])
10 AC_REQUIRE([gl_FUNC_MKTIME_WORKS]) 11 AC_REQUIRE([gl_FUNC_MKTIME_WORKS])
11 REPLACE_TIMEGM=0 12 gl_CHECK_FUNCS_ANDROID([timegm], [[#include <time.h>]])
12 AC_CHECK_FUNCS_ONCE([timegm])
13 if test $ac_cv_func_timegm = yes; then 13 if test $ac_cv_func_timegm = yes; then
14 if test "$gl_cv_func_working_mktime" != yes; then 14 if test "$gl_cv_func_working_mktime" != yes; then
15 # Assume that timegm is buggy if mktime is. 15 # Assume that timegm is buggy if mktime is.
@@ -17,6 +17,9 @@ AC_DEFUN([gl_FUNC_TIMEGM],
17 fi 17 fi
18 else 18 else
19 HAVE_TIMEGM=0 19 HAVE_TIMEGM=0
20 case "$gl_cv_onwards_func_timegm" in
21 future*) REPLACE_TIMEGM=1 ;;
22 esac
20 fi 23 fi
21]) 24])
22 25
diff --git a/gl/m4/ungetc.m4 b/gl/m4/ungetc.m4
index 8977a346..42f7ec32 100644
--- a/gl/m4/ungetc.m4
+++ b/gl/m4/ungetc.m4
@@ -1,5 +1,6 @@
1# ungetc.m4 serial 10 1# ungetc.m4
2dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. 2# serial 12
3dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -42,16 +43,16 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
42 ]])], 43 ]])],
43 [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no], 44 [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
44 [case "$host_os" in 45 [case "$host_os" in
45 # Guess yes on glibc systems. 46 # Guess yes on glibc systems.
46 *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;; 47 *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
47 # Guess yes on musl systems. 48 # Guess yes on musl systems.
48 *-musl*) gl_cv_func_ungetc_works="guessing yes" ;; 49 *-musl* | midipix*) gl_cv_func_ungetc_works="guessing yes" ;;
49 # Guess yes on bionic systems. 50 # Guess yes on bionic systems.
50 *-android*) gl_cv_func_ungetc_works="guessing yes" ;; 51 *-android*) gl_cv_func_ungetc_works="guessing yes" ;;
51 # Guess yes on native Windows. 52 # Guess yes on native Windows.
52 mingw*) gl_cv_func_ungetc_works="guessing yes" ;; 53 mingw* | windows*) gl_cv_func_ungetc_works="guessing yes" ;;
53 # If we don't know, obey --enable-cross-guesses. 54 # If we don't know, obey --enable-cross-guesses.
54 *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;; 55 *) gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
55 esac 56 esac
56 ]) 57 ])
57 ]) 58 ])
diff --git a/gl/m4/unistd_h.m4 b/gl/m4/unistd_h.m4
index f4384027..81d1b9f6 100644
--- a/gl/m4/unistd_h.m4
+++ b/gl/m4/unistd_h.m4
@@ -1,5 +1,6 @@
1# unistd_h.m4 serial 90 1# unistd_h.m4
2dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 2# serial 95
3dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -225,6 +226,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
225 REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE]) 226 REPLACE_COPY_FILE_RANGE=0; AC_SUBST([REPLACE_COPY_FILE_RANGE])
226 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP]) 227 REPLACE_DUP=0; AC_SUBST([REPLACE_DUP])
227 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2]) 228 REPLACE_DUP2=0; AC_SUBST([REPLACE_DUP2])
229 REPLACE_DUP3=0; AC_SUBST([REPLACE_DUP3])
228 REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL]) 230 REPLACE_EXECL=0; AC_SUBST([REPLACE_EXECL])
229 REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE]) 231 REPLACE_EXECLE=0; AC_SUBST([REPLACE_EXECLE])
230 REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP]) 232 REPLACE_EXECLP=0; AC_SUBST([REPLACE_EXECLP])
@@ -233,11 +235,14 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
233 REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP]) 235 REPLACE_EXECVP=0; AC_SUBST([REPLACE_EXECVP])
234 REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE]) 236 REPLACE_EXECVPE=0; AC_SUBST([REPLACE_EXECVPE])
235 REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT]) 237 REPLACE_FACCESSAT=0; AC_SUBST([REPLACE_FACCESSAT])
238 REPLACE_FCHDIR=0; AC_SUBST([REPLACE_FCHDIR])
236 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT]) 239 REPLACE_FCHOWNAT=0; AC_SUBST([REPLACE_FCHOWNAT])
240 REPLACE_FDATASYNC=0; AC_SUBST([REPLACE_FDATASYNC])
237 REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE]) 241 REPLACE_FTRUNCATE=0; AC_SUBST([REPLACE_FTRUNCATE])
238 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD]) 242 REPLACE_GETCWD=0; AC_SUBST([REPLACE_GETCWD])
239 REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME]) 243 REPLACE_GETDOMAINNAME=0; AC_SUBST([REPLACE_GETDOMAINNAME])
240 REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE]) 244 REPLACE_GETDTABLESIZE=0; AC_SUBST([REPLACE_GETDTABLESIZE])
245 REPLACE_GETENTROPY=0; AC_SUBST([REPLACE_GETENTROPY])
241 REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R]) 246 REPLACE_GETLOGIN_R=0; AC_SUBST([REPLACE_GETLOGIN_R])
242 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS]) 247 REPLACE_GETGROUPS=0; AC_SUBST([REPLACE_GETGROUPS])
243 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE]) 248 REPLACE_GETPAGESIZE=0; AC_SUBST([REPLACE_GETPAGESIZE])
@@ -248,12 +253,14 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
248 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK]) 253 REPLACE_LINK=0; AC_SUBST([REPLACE_LINK])
249 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT]) 254 REPLACE_LINKAT=0; AC_SUBST([REPLACE_LINKAT])
250 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK]) 255 REPLACE_LSEEK=0; AC_SUBST([REPLACE_LSEEK])
256 REPLACE_PIPE2=0; AC_SUBST([REPLACE_PIPE2])
251 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD]) 257 REPLACE_PREAD=0; AC_SUBST([REPLACE_PREAD])
252 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE]) 258 REPLACE_PWRITE=0; AC_SUBST([REPLACE_PWRITE])
253 REPLACE_READ=0; AC_SUBST([REPLACE_READ]) 259 REPLACE_READ=0; AC_SUBST([REPLACE_READ])
254 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK]) 260 REPLACE_READLINK=0; AC_SUBST([REPLACE_READLINK])
255 REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT]) 261 REPLACE_READLINKAT=0; AC_SUBST([REPLACE_READLINKAT])
256 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR]) 262 REPLACE_RMDIR=0; AC_SUBST([REPLACE_RMDIR])
263 REPLACE_SETHOSTNAME=0; AC_SUBST([REPLACE_SETHOSTNAME])
257 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP]) 264 REPLACE_SLEEP=0; AC_SUBST([REPLACE_SLEEP])
258 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK]) 265 REPLACE_SYMLINK=0; AC_SUBST([REPLACE_SYMLINK])
259 REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT]) 266 REPLACE_SYMLINKAT=0; AC_SUBST([REPLACE_SYMLINKAT])
diff --git a/gl/m4/unlocked-io.m4 b/gl/m4/unlocked-io.m4
index 407c0bac..e96cf5f8 100644
--- a/gl/m4/unlocked-io.m4
+++ b/gl/m4/unlocked-io.m4
@@ -1,10 +1,9 @@
1# unlocked-io.m4 serial 16 1# unlocked-io.m4
2 2# serial 16
3# Copyright (C) 1998-2006, 2009-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 1998-2006, 2009-2024 Free Software Foundation, Inc.
4# 4dnl This file is free software; the Free Software Foundation
5# This file is free software; the Free Software Foundation 5dnl gives unlimited permission to copy and/or distribute it,
6# gives unlimited permission to copy and/or distribute it, 6dnl with or without modifications, as long as this notice is preserved.
7# with or without modifications, as long as this notice is preserved.
8 7
9dnl From Jim Meyering. 8dnl From Jim Meyering.
10dnl 9dnl
diff --git a/gl/m4/vararrays.m4 b/gl/m4/vararrays.m4
index fd6230c2..9211f69d 100644
--- a/gl/m4/vararrays.m4
+++ b/gl/m4/vararrays.m4
@@ -1,13 +1,13 @@
1# Check for variable-length arrays. 1# vararrays.m4
2
3# serial 6 2# serial 6
3dnl Copyright (C) 2001, 2009-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
4 7
5# From Paul Eggert 8# Check for variable-length arrays.
6 9
7# Copyright (C) 2001, 2009-2023 Free Software Foundation, Inc. 10# From Paul Eggert
8# This file is free software; the Free Software Foundation
9# gives unlimited permission to copy and/or distribute it,
10# with or without modifications, as long as this notice is preserved.
11 11
12m4_version_prereq([2.70], [], [ 12m4_version_prereq([2.70], [], [
13 13
diff --git a/gl/m4/vasnprintf.m4 b/gl/m4/vasnprintf.m4
index 6361c843..1ea2055e 100644
--- a/gl/m4/vasnprintf.m4
+++ b/gl/m4/vasnprintf.m4
@@ -1,5 +1,6 @@
1# vasnprintf.m4 serial 38 1# vasnprintf.m4
2dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc. 2# serial 52
3dnl Copyright (C) 2002-2004, 2006-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -29,6 +30,15 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
29 gl_PREREQ_ASNPRINTF 30 gl_PREREQ_ASNPRINTF
30]) 31])
31 32
33AC_DEFUN([gl_FUNC_VASNWPRINTF],
34[
35 AC_LIBOBJ([printf-args])
36 gl_PREREQ_PRINTF_ARGS
37 gl_PREREQ_PRINTF_PARSE
38 gl_PREREQ_VASNWPRINTF
39 gl_PREREQ_ASNPRINTF
40])
41
32# Prerequisites of lib/printf-args.h, lib/printf-args.c. 42# Prerequisites of lib/printf-args.h, lib/printf-args.c.
33AC_DEFUN([gl_PREREQ_PRINTF_ARGS], 43AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
34[ 44[
@@ -37,6 +47,7 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
37]) 47])
38 48
39# Prerequisites of lib/printf-parse.h, lib/printf-parse.c. 49# Prerequisites of lib/printf-parse.h, lib/printf-parse.c.
50# Prerequisites of lib/wprintf-parse.h, lib/wprintf-parse.c.
40AC_DEFUN([gl_PREREQ_PRINTF_PARSE], 51AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
41[ 52[
42 AC_REQUIRE([gl_FEATURES_H]) 53 AC_REQUIRE([gl_FEATURES_H])
@@ -50,19 +61,13 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
50 AC_REQUIRE([gt_AC_TYPE_INTMAX_T]) 61 AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
51]) 62])
52 63
53# Prerequisites of lib/vasnprintf.c. 64# Prerequisites of lib/vasnprintf.c if !WIDE_CHAR_VERSION.
54AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF], 65AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
55[ 66[
56 AC_REQUIRE([AC_FUNC_ALLOCA]) 67 AC_CHECK_FUNCS([snprintf strnlen wcrtomb])
57 AC_REQUIRE([gt_TYPE_WCHAR_T])
58 AC_REQUIRE([gt_TYPE_WINT_T])
59 AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
60 dnl Use the _snprintf function only if it is declared (because on NetBSD it 68 dnl Use the _snprintf function only if it is declared (because on NetBSD it
61 dnl is defined as a weak alias of snprintf; we prefer to use the latter). 69 dnl is defined as a weak alias of snprintf; we prefer to use the latter).
62 AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]]) 70 AC_CHECK_DECLS([_snprintf], , , [[#include <stdio.h>]])
63 dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
64 dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
65 AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
66 dnl We can avoid a lot of code by assuming that snprintf's return value 71 dnl We can avoid a lot of code by assuming that snprintf's return value
67 dnl conforms to ISO C99. So check that. 72 dnl conforms to ISO C99. So check that.
68 AC_REQUIRE([gl_SNPRINTF_RETVAL_C99]) 73 AC_REQUIRE([gl_SNPRINTF_RETVAL_C99])
@@ -84,6 +89,108 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
84 terminated.]) 89 terminated.])
85 ;; 90 ;;
86 esac 91 esac
92 gl_PREREQ_VASNXPRINTF
93])
94
95# Prerequisites of lib/vasnwprintf.c.
96AC_DEFUN_ONCE([gl_PREREQ_VASNWPRINTF],
97[
98 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
99 AC_CHECK_FUNCS_ONCE([swprintf wcsnlen mbrtowc])
100 AC_CHECK_DECLS([_snwprintf], , , [[#include <stdio.h>]])
101 AC_CHECK_DECLS([wcsnlen], , , [[#include <wchar.h>]])
102 gl_SWPRINTF_WORKS
103 case "$gl_cv_func_swprintf_works" in
104 *yes)
105 AC_DEFINE([HAVE_WORKING_SWPRINTF], [1],
106 [Define if the swprintf function works correctly when it produces output
107 that contains null wide characters.])
108 ;;
109 esac
110 gl_MBRTOWC_C_LOCALE
111 case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
112 *yes)
113 AC_CACHE_CHECK([whether swprintf in the C locale is free of encoding errors],
114 [gl_cv_func_swprintf_C_locale_sans_EILSEQ],
115 [
116 AC_RUN_IFELSE(
117 [AC_LANG_SOURCE([[
118#ifndef __USE_MINGW_ANSI_STDIO
119# define __USE_MINGW_ANSI_STDIO 1
120#endif
121#include <stdio.h>
122#include <wchar.h>
123int main()
124{
125 int result = 0;
126 { /* This test fails on glibc 2.35, musl libc 1.2.4, FreeBSD 13.2, NetBSD 9.3,
127 OpenBSD 7.2, Cygwin 2.9.0.
128 Reported at <https://www.openwall.com/lists/musl/2023/06/12/2>. */
129 wchar_t buf[12];
130 int ret = swprintf (buf, 12, L"%c", '\377');
131 if (ret < 0)
132 result |= 1;
133 }
134 return result;
135}]])],
136 [gl_cv_func_swprintf_C_locale_sans_EILSEQ=yes],
137 [gl_cv_func_swprintf_C_locale_sans_EILSEQ=no],
138 [case "$host_os" in
139 # Guess no on glibc systems.
140 *-gnu* | gnu*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing yes";;
141 # Guess no on musl systems.
142 *-musl* | midipix*) gl_cv_func_swprintf_C_locale_sans_EILSEQ="guessing no";;
143 # If we don't know, obey --enable-cross-guesses.
144 *) gl_cv_func_swprintf_C_locale_sans_EILSEQ="$gl_cross_guess_normal";;
145 esac
146 ])
147 ])
148 ;;
149 esac
150 if case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
151 *yes) false ;;
152 *) true ;;
153 esac \
154 || case "$gl_cv_func_swprintf_C_locale_sans_EILSEQ" in
155 *yes) false ;;
156 *) true ;;
157 esac; then
158 AC_DEFINE([NEED_WPRINTF_DIRECTIVE_C], [1],
159 [Define if the vasnwprintf implementation needs special code for
160 the 'c' directive.])
161 fi
162 gl_SWPRINTF_DIRECTIVE_LA
163 case "$gl_cv_func_swprintf_directive_la" in
164 *yes) ;;
165 *)
166 AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LA], [1],
167 [Define if the vasnwprintf implementation needs special code for
168 the 'a' directive with 'long double' arguments.])
169 ;;
170 esac
171 gl_SWPRINTF_DIRECTIVE_LC
172 case "$gl_cv_func_swprintf_directive_lc" in
173 *yes) ;;
174 *)
175 AC_DEFINE([NEED_WPRINTF_DIRECTIVE_LC], [1],
176 [Define if the vasnwprintf implementation needs special code for
177 the 'lc' directive.])
178 ;;
179 esac
180 gl_MUSL_LIBC
181 gl_PREREQ_VASNXPRINTF
182])
183
184# Common prerequisites of lib/vasnprintf.c and lib/vasnwprintf.c.
185AC_DEFUN_ONCE([gl_PREREQ_VASNXPRINTF],
186[
187 AC_REQUIRE([AC_FUNC_ALLOCA])
188 AC_REQUIRE([gt_TYPE_WCHAR_T])
189 AC_REQUIRE([gt_TYPE_WINT_T])
190 AC_CHECK_FUNCS([wcslen])
191 dnl Knowing DBL_EXPBIT0_WORD and DBL_EXPBIT0_BIT enables an optimization
192 dnl in the code for NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE.
193 AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
87]) 194])
88 195
89# Extra prerequisites of lib/vasnprintf.c for supporting 'long double' 196# Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
@@ -152,7 +259,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A],
152 AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1], 259 AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], [1],
153 [Define if the vasnprintf implementation needs special code for 260 [Define if the vasnprintf implementation needs special code for
154 the 'a' and 'A' directives.]) 261 the 'a' and 'A' directives.])
155 AC_CHECK_FUNCS([nl_langinfo]) 262 gl_CHECK_FUNCS_ANDROID([nl_langinfo], [[#include <langinfo.h>]])
263 ;;
264 esac
265])
266
267# Extra prerequisites of lib/vasnprintf.c for supporting the 'b' directive.
268AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_B],
269[
270 AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
271 case "$gl_cv_func_printf_directive_b" in
272 *yes)
273 ;;
274 *)
275 AC_DEFINE([NEED_PRINTF_DIRECTIVE_B], [1],
276 [Define if the vasnprintf implementation needs special code for
277 the 'b' directive.])
156 ;; 278 ;;
157 esac 279 esac
158]) 280])
@@ -187,6 +309,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LS],
187 esac 309 esac
188]) 310])
189 311
312# Extra prerequisites of lib/vasnprintf.c for supporting the 'lc' directive.
313AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_LC],
314[
315 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
316 case "$gl_cv_func_printf_directive_lc" in
317 *yes)
318 ;;
319 *)
320 AC_DEFINE([NEED_PRINTF_DIRECTIVE_LC], [1],
321 [Define if the vasnprintf implementation needs special code for
322 the 'lc' directive.])
323 ;;
324 esac
325])
326
190# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag. 327# Extra prerequisites of lib/vasnprintf.c for supporting the ' flag.
191AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING], 328AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_GROUPING],
192[ 329[
@@ -232,6 +369,22 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ZERO],
232 esac 369 esac
233]) 370])
234 371
372# Extra prerequisites of lib/vasnprintf.c for supporting the # flag with a
373# zero precision and a zero value in the 'x' and 'X' directives.
374AC_DEFUN([gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO],
375[
376 AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO])
377 case "$gl_cv_func_printf_flag_alt_precision_zero" in
378 *yes)
379 ;;
380 *)
381 AC_DEFINE([NEED_PRINTF_FLAG_ALT_PRECISION_ZERO], [1],
382 [Define if the vasnprintf implementation needs special code for the
383 # flag with a zero precision and a zero value in the 'x' and 'X' directives.])
384 ;;
385 esac
386])
387
235# Extra prerequisites of lib/vasnprintf.c for supporting large precisions. 388# Extra prerequisites of lib/vasnprintf.c for supporting large precisions.
236AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION], 389AC_DEFUN([gl_PREREQ_VASNPRINTF_PRECISION],
237[ 390[
@@ -276,23 +429,53 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_ENOMEM],
276]) 429])
277 430
278# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance. 431# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance.
279AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], 432AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS],
280[ 433[
281 AC_REQUIRE([gl_PREREQ_VASNPRINTF]) 434 AC_REQUIRE([gl_PREREQ_VASNPRINTF])
282 gl_PREREQ_VASNPRINTF_LONG_DOUBLE 435 gl_PREREQ_VASNPRINTF_LONG_DOUBLE
283 gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE 436 gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE
284 gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE 437 gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE
285 gl_PREREQ_VASNPRINTF_DIRECTIVE_A 438 gl_PREREQ_VASNPRINTF_DIRECTIVE_A
439 gl_PREREQ_VASNPRINTF_DIRECTIVE_B
286 gl_PREREQ_VASNPRINTF_DIRECTIVE_F 440 gl_PREREQ_VASNPRINTF_DIRECTIVE_F
287 gl_PREREQ_VASNPRINTF_DIRECTIVE_LS 441 gl_PREREQ_VASNPRINTF_DIRECTIVE_LS
442 gl_PREREQ_VASNPRINTF_DIRECTIVE_LC
288 gl_PREREQ_VASNPRINTF_FLAG_GROUPING 443 gl_PREREQ_VASNPRINTF_FLAG_GROUPING
289 gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST 444 gl_PREREQ_VASNPRINTF_FLAG_LEFTADJUST
290 gl_PREREQ_VASNPRINTF_FLAG_ZERO 445 gl_PREREQ_VASNPRINTF_FLAG_ZERO
446 gl_PREREQ_VASNPRINTF_FLAG_ALT_PRECISION_ZERO
291 gl_PREREQ_VASNPRINTF_PRECISION 447 gl_PREREQ_VASNPRINTF_PRECISION
292 gl_PREREQ_VASNPRINTF_ENOMEM 448 gl_PREREQ_VASNPRINTF_ENOMEM
293]) 449])
294 450
451# Extra prerequisites of lib/vasnprintf.c for supporting the 'B' directive.
452AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B],
453[
454 AC_REQUIRE([gl_PRINTF_DIRECTIVE_UPPERCASE_B])
455 case "$gl_cv_func_printf_directive_uppercase_b" in
456 *yes)
457 ;;
458 *)
459 AC_DEFINE([NEED_PRINTF_DIRECTIVE_UPPERCASE_B], [1],
460 [Define if the vasnprintf implementation needs special code for
461 the 'B' directive.])
462 ;;
463 esac
464])
465
466# Prerequisites of lib/vasnprintf.c including all extras for POSIX compliance
467# and GNU compatibility.
468AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_GNU_EXTRAS],
469[
470 gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
471 AC_DEFINE([SUPPORT_GNU_PRINTF_DIRECTIVES], [1],
472 [Define if the vasnprintf implementation should support GNU compatible
473 printf directives.])
474 gl_PREREQ_VASNPRINTF_DIRECTIVE_UPPERCASE_B
475])
476
295# Prerequisites of lib/asnprintf.c. 477# Prerequisites of lib/asnprintf.c.
478# Prerequisites of lib/asnwprintf.c.
296AC_DEFUN([gl_PREREQ_ASNPRINTF], 479AC_DEFUN([gl_PREREQ_ASNPRINTF],
297[ 480[
298]) 481])
diff --git a/gl/m4/vasprintf.m4 b/gl/m4/vasprintf.m4
index 6e6156a7..73f7b807 100644
--- a/gl/m4/vasprintf.m4
+++ b/gl/m4/vasprintf.m4
@@ -1,5 +1,6 @@
1# vasprintf.m4 serial 6 1# vasprintf.m4
2dnl Copyright (C) 2002-2003, 2006-2007, 2009-2023 Free Software Foundation, 2# serial 6
3dnl Copyright (C) 2002-2003, 2006-2007, 2009-2024 Free Software Foundation,
3dnl Inc. 4dnl Inc.
4dnl This file is free software; the Free Software Foundation 5dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 6dnl gives unlimited permission to copy and/or distribute it,
diff --git a/gl/m4/visibility.m4 b/gl/m4/visibility.m4
index f0468e89..ecf09686 100644
--- a/gl/m4/visibility.m4
+++ b/gl/m4/visibility.m4
@@ -1,5 +1,6 @@
1# visibility.m4 serial 8 1# visibility.m4
2dnl Copyright (C) 2005, 2008, 2010-2023 Free Software Foundation, Inc. 2# serial 9
3dnl Copyright (C) 2005, 2008, 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -31,18 +32,18 @@ AC_DEFUN([gl_VISIBILITY],
31 dnl user has put into $CC $CFLAGS $CPPFLAGS. 32 dnl user has put into $CC $CFLAGS $CPPFLAGS.
32 AC_CACHE_CHECK([whether the -Werror option is usable], 33 AC_CACHE_CHECK([whether the -Werror option is usable],
33 [gl_cv_cc_vis_werror], 34 [gl_cv_cc_vis_werror],
34 [gl_save_CFLAGS="$CFLAGS" 35 [gl_saved_CFLAGS="$CFLAGS"
35 CFLAGS="$CFLAGS -Werror" 36 CFLAGS="$CFLAGS -Werror"
36 AC_COMPILE_IFELSE( 37 AC_COMPILE_IFELSE(
37 [AC_LANG_PROGRAM([[]], [[]])], 38 [AC_LANG_PROGRAM([[]], [[]])],
38 [gl_cv_cc_vis_werror=yes], 39 [gl_cv_cc_vis_werror=yes],
39 [gl_cv_cc_vis_werror=no]) 40 [gl_cv_cc_vis_werror=no])
40 CFLAGS="$gl_save_CFLAGS" 41 CFLAGS="$gl_saved_CFLAGS"
41 ]) 42 ])
42 dnl Now check whether visibility declarations are supported. 43 dnl Now check whether visibility declarations are supported.
43 AC_CACHE_CHECK([for simple visibility declarations], 44 AC_CACHE_CHECK([for simple visibility declarations],
44 [gl_cv_cc_visibility], 45 [gl_cv_cc_visibility],
45 [gl_save_CFLAGS="$CFLAGS" 46 [gl_saved_CFLAGS="$CFLAGS"
46 CFLAGS="$CFLAGS -fvisibility=hidden" 47 CFLAGS="$CFLAGS -fvisibility=hidden"
47 dnl We use the option -Werror and a function dummyfunc, because on some 48 dnl We use the option -Werror and a function dummyfunc, because on some
48 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning 49 dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
@@ -68,7 +69,7 @@ AC_DEFUN([gl_VISIBILITY],
68 [[]])], 69 [[]])],
69 [gl_cv_cc_visibility=yes], 70 [gl_cv_cc_visibility=yes],
70 [gl_cv_cc_visibility=no]) 71 [gl_cv_cc_visibility=no])
71 CFLAGS="$gl_save_CFLAGS" 72 CFLAGS="$gl_saved_CFLAGS"
72 ]) 73 ])
73 if test $gl_cv_cc_visibility = yes; then 74 if test $gl_cv_cc_visibility = yes; then
74 CFLAG_VISIBILITY="-fvisibility=hidden" 75 CFLAG_VISIBILITY="-fvisibility=hidden"
diff --git a/gl/m4/vsnprintf.m4 b/gl/m4/vsnprintf.m4
index 7fbb11c4..9f321f3f 100644
--- a/gl/m4/vsnprintf.m4
+++ b/gl/m4/vsnprintf.m4
@@ -1,5 +1,6 @@
1# vsnprintf.m4 serial 7 1# vsnprintf.m4
2dnl Copyright (C) 2002-2004, 2007-2023 Free Software Foundation, Inc. 2# serial 7
3dnl Copyright (C) 2002-2004, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/warn-on-use.m4 b/gl/m4/warn-on-use.m4
index 10649c5c..6c8c76b8 100644
--- a/gl/m4/warn-on-use.m4
+++ b/gl/m4/warn-on-use.m4
@@ -1,5 +1,6 @@
1# warn-on-use.m4 serial 10 1# warn-on-use.m4
2dnl Copyright (C) 2010-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2010-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -36,7 +37,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
36 dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead 37 dnl clang (e.g. strndup), reference ac_compile_for_check_decl instead
37 dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC 38 dnl of ac_compile. If, for whatever reason, the override of AC_PROG_CC
38 dnl in zzgnulib.m4 is inactive, use the original ac_compile. 39 dnl in zzgnulib.m4 is inactive, use the original ac_compile.
39 ac_save_ac_compile="$ac_compile" 40 ac_saved_ac_compile="$ac_compile"
40 if test -n "$ac_compile_for_check_decl"; then 41 if test -n "$ac_compile_for_check_decl"; then
41 ac_compile="$ac_compile_for_check_decl" 42 ac_compile="$ac_compile_for_check_decl"
42 fi 43 fi
@@ -46,7 +47,7 @@ AC_DEFUN([gl_WARN_ON_USE_PREPARE],
46[[#undef $gl_func 47[[#undef $gl_func
47 (void) $gl_func;]])], 48 (void) $gl_func;]])],
48 [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])]) 49 [AS_VAR_SET([gl_Symbol], [yes])], [AS_VAR_SET([gl_Symbol], [no])])])
49 ac_compile="$ac_save_ac_compile" 50 ac_compile="$ac_saved_ac_compile"
50 AS_VAR_IF([gl_Symbol], [yes], 51 AS_VAR_IF([gl_Symbol], [yes],
51 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1]) 52 [AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_RAW_DECL_$gl_func]), [1])
52 dnl Shortcut for an AC_CHECK_DECL invocation that may come later: 53 dnl Shortcut for an AC_CHECK_DECL invocation that may come later:
diff --git a/gl/m4/wchar_h.m4 b/gl/m4/wchar_h.m4
index 8ec66193..995bdc65 100644
--- a/gl/m4/wchar_h.m4
+++ b/gl/m4/wchar_h.m4
@@ -1,13 +1,13 @@
1dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues. 1# wchar_h.m4
2 2# serial 64
3dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. 3dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
7 7
8dnl Written by Eric Blake. 8dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
9 9
10# wchar_h.m4 serial 55 10dnl Written by Eric Blake.
11 11
12AC_DEFUN_ONCE([gl_WCHAR_H], 12AC_DEFUN_ONCE([gl_WCHAR_H],
13[ 13[
@@ -86,8 +86,8 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
86 dnl z/OS when using the XPLINK object format (due to duplicate 86 dnl z/OS when using the XPLINK object format (due to duplicate
87 dnl CSECT names). Instead, temporarily redefine $ac_compile so 87 dnl CSECT names). Instead, temporarily redefine $ac_compile so
88 dnl that the object file has the latter name from the start. 88 dnl that the object file has the latter name from the start.
89 save_ac_compile="$ac_compile" 89 saved_ac_compile="$ac_compile"
90 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/` 90 ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest1/`
91 if echo '#include "conftest.c"' >conftest1.c \ 91 if echo '#include "conftest.c"' >conftest1.c \
92 && AC_TRY_EVAL([ac_compile]); then 92 && AC_TRY_EVAL([ac_compile]); then
93 AC_LANG_CONFTEST([ 93 AC_LANG_CONFTEST([
@@ -97,7 +97,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
97 int zero (void) { return 0; } 97 int zero (void) { return 0; }
98 ]])]) 98 ]])])
99 dnl See note above about renaming object files. 99 dnl See note above about renaming object files.
100 ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/` 100 ac_compile=`echo "$saved_ac_compile" | sed s/conftest/conftest2/`
101 if echo '#include "conftest.c"' >conftest2.c \ 101 if echo '#include "conftest.c"' >conftest2.c \
102 && AC_TRY_EVAL([ac_compile]); then 102 && AC_TRY_EVAL([ac_compile]); then
103 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then 103 if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
@@ -107,7 +107,7 @@ AC_DEFUN([gl_WCHAR_H_INLINE_OK],
107 fi 107 fi
108 fi 108 fi
109 fi 109 fi
110 ac_compile="$save_ac_compile" 110 ac_compile="$saved_ac_compile"
111 rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext 111 rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
112 ;; 112 ;;
113 esac 113 esac
@@ -147,6 +147,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
147 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC]) 147 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC])
148 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB]) 148 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB])
149 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT]) 149 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT])
150 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSZERO])
150 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC]) 151 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC])
151 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN]) 152 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN])
152 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS]) 153 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS])
@@ -185,6 +186,7 @@ AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
185 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK]) 186 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
186 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH]) 187 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
187 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME]) 188 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
189 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WGETCWD])
188 dnl Support Microsoft deprecated alias function names by default. 190 dnl Support Microsoft deprecated alias function names by default.
189 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1]) 191 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
190 ]) 192 ])
@@ -253,5 +255,10 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
253 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) 255 REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
254 REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH]) 256 REPLACE_WCSWIDTH=0; AC_SUBST([REPLACE_WCSWIDTH])
255 REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME]) 257 REPLACE_WCSFTIME=0; AC_SUBST([REPLACE_WCSFTIME])
258 REPLACE_WCSCMP=0; AC_SUBST([REPLACE_WCSCMP])
259 REPLACE_WCSNCMP=0; AC_SUBST([REPLACE_WCSNCMP])
260 REPLACE_WCSSTR=0; AC_SUBST([REPLACE_WCSSTR])
256 REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK]) 261 REPLACE_WCSTOK=0; AC_SUBST([REPLACE_WCSTOK])
262 REPLACE_WMEMCMP=0; AC_SUBST([REPLACE_WMEMCMP])
263 REPLACE_WMEMPCPY=0; AC_SUBST([REPLACE_WMEMPCPY])
257]) 264])
diff --git a/gl/m4/wchar_t.m4 b/gl/m4/wchar_t.m4
index 50bde08a..968832cb 100644
--- a/gl/m4/wchar_t.m4
+++ b/gl/m4/wchar_t.m4
@@ -1,5 +1,6 @@
1# wchar_t.m4 serial 4 (gettext-0.18.2) 1# wchar_t.m4
2dnl Copyright (C) 2002-2003, 2008-2023 Free Software Foundation, Inc. 2# serial 4 (gettext-0.18.2)
3dnl Copyright (C) 2002-2003, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/wcrtomb.m4 b/gl/m4/wcrtomb.m4
index d51b36e1..35dff6f0 100644
--- a/gl/m4/wcrtomb.m4
+++ b/gl/m4/wcrtomb.m4
@@ -1,5 +1,6 @@
1# wcrtomb.m4 serial 17 1# wcrtomb.m4
2dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. 2# serial 19
3dnl Copyright (C) 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
@@ -82,9 +83,11 @@ int main ()
82changequote(,)dnl 83changequote(,)dnl
83 case "$host_os" in 84 case "$host_os" in
84 # Guess no on AIX 4, OSF/1, Solaris, native Windows. 85 # Guess no on AIX 4, OSF/1, Solaris, native Windows.
85 aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;; 86 aix4* | osf* | solaris* | mingw* | windows*)
87 gl_cv_func_wcrtomb_retval="guessing no" ;;
86 # Guess yes otherwise. 88 # Guess yes otherwise.
87 *) gl_cv_func_wcrtomb_retval="guessing yes" ;; 89 *)
90 gl_cv_func_wcrtomb_retval="guessing yes" ;;
88 esac 91 esac
89changequote([,])dnl 92changequote([,])dnl
90 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then 93 if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
@@ -97,12 +100,14 @@ changequote([,])dnl
97int main () 100int main ()
98{ 101{
99 int result = 0; 102 int result = 0;
100 if (setlocale (LC_ALL, "$LOCALE_FR") != NULL) 103 if (strcmp ("$LOCALE_FR", "none") != 0
104 && setlocale (LC_ALL, "$LOCALE_FR") != NULL)
101 { 105 {
102 if (wcrtomb (NULL, 0, NULL) != 1) 106 if (wcrtomb (NULL, 0, NULL) != 1)
103 result |= 1; 107 result |= 1;
104 } 108 }
105 if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL) 109 if (strcmp ("$LOCALE_FR_UTF8", "none") != 0
110 && setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
106 { 111 {
107 if (wcrtomb (NULL, 0, NULL) != 1) 112 if (wcrtomb (NULL, 0, NULL) != 1)
108 result |= 2; 113 result |= 2;
@@ -113,12 +118,14 @@ int main ()
113 result |= 2; 118 result |= 2;
114 } 119 }
115 } 120 }
116 if (setlocale (LC_ALL, "$LOCALE_JA") != NULL) 121 if (strcmp ("$LOCALE_JA", "none") != 0
122 && setlocale (LC_ALL, "$LOCALE_JA") != NULL)
117 { 123 {
118 if (wcrtomb (NULL, 0, NULL) != 1) 124 if (wcrtomb (NULL, 0, NULL) != 1)
119 result |= 4; 125 result |= 4;
120 } 126 }
121 if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL) 127 if (strcmp ("$LOCALE_ZH_CN", "none") != 0
128 && setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
122 { 129 {
123 if (wcrtomb (NULL, 0, NULL) != 1) 130 if (wcrtomb (NULL, 0, NULL) != 1)
124 result |= 8; 131 result |= 8;
diff --git a/gl/m4/wctype.m4 b/gl/m4/wctype.m4
new file mode 100644
index 00000000..e5d70740
--- /dev/null
+++ b/gl/m4/wctype.m4
@@ -0,0 +1,52 @@
1# wctype.m4
2# serial 6
3dnl Copyright (C) 2011-2024 Free Software Foundation, Inc.
4dnl This file is free software; the Free Software Foundation
5dnl gives unlimited permission to copy and/or distribute it,
6dnl with or without modifications, as long as this notice is preserved.
7
8AC_DEFUN_ONCE([gl_FUNC_WCTYPE],
9[
10 AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
11 AC_REQUIRE([gl_WCTYPE_H])
12 AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
13 HAVE_WCTYPE=$HAVE_WCTYPE_T
14 if test $HAVE_WCTYPE = 1; then
15 AC_CACHE_CHECK([whether wctype supports the "blank" and "punct" character classes],
16 [gl_cv_func_wctype_works],
17 [AC_RUN_IFELSE(
18 [AC_LANG_SOURCE([[
19 #include <ctype.h>
20 #include <wchar.h>
21 #include <wctype.h>
22 int main ()
23 {
24 /* This test fails on mingw. */
25 if (wctype ("blank") == (wctype_t)0)
26 return 1;
27 /* This test fails on MSVC 14. */
28 if ((! iswctype ('\t', wctype ("blank"))) != (! iswblank ('\t')))
29 return 2;
30 /* This test fails on Android 11. */
31 if ((! iswctype ('\`', wctype ("punct"))) != (! ispunct ('\`')))
32 return 4;
33 return 0;
34 }
35 ]])],
36 [gl_cv_func_wctype_works=yes], [gl_cv_func_wctype_works=no],
37 [case "$host_os" in
38 # Guess no on native Windows.
39 mingw* | windows*) gl_cv_func_wctype_works="guessing no" ;;
40 # Guess no on Android.
41 android*) gl_cv_func_wctype_works="guessing no" ;;
42 # Guess yes otherwise.
43 *) gl_cv_func_wctype_works="guessing yes" ;;
44 esac
45 ])
46 ])
47 case "$gl_cv_func_wctype_works" in
48 *yes) ;;
49 *) REPLACE_WCTYPE=1 ;;
50 esac
51 fi
52])
diff --git a/gl/m4/wctype_h.m4 b/gl/m4/wctype_h.m4
index 6856a735..a3b07c2a 100644
--- a/gl/m4/wctype_h.m4
+++ b/gl/m4/wctype_h.m4
@@ -1,8 +1,9 @@
1# wctype_h.m4 serial 30 1# wctype_h.m4
2# serial 33
2 3
3dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it. 4dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
4 5
5dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. 6dnl Copyright (C) 2006-2024 Free Software Foundation, Inc.
6dnl This file is free software; the Free Software Foundation 7dnl This file is free software; the Free Software Foundation
7dnl gives unlimited permission to copy and/or distribute it, 8dnl gives unlimited permission to copy and/or distribute it,
8dnl with or without modifications, as long as this notice is preserved. 9dnl with or without modifications, as long as this notice is preserved.
@@ -178,6 +179,7 @@ AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS],
178 m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [ 179 m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [
179 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK]) 180 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK])
180 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT]) 181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT])
182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWPUNCT])
181 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT]) 183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT])
182 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE]) 184 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE])
183 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE]) 185 gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE])
@@ -196,5 +198,8 @@ AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
196 HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T]) 198 HAVE_WCTRANS_T=1; AC_SUBST([HAVE_WCTRANS_T])
197 REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK]) 199 REPLACE_ISWBLANK=0; AC_SUBST([REPLACE_ISWBLANK])
198 REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT]) 200 REPLACE_ISWDIGIT=0; AC_SUBST([REPLACE_ISWDIGIT])
201 REPLACE_ISWPUNCT=0; AC_SUBST([REPLACE_ISWPUNCT])
199 REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT]) 202 REPLACE_ISWXDIGIT=0; AC_SUBST([REPLACE_ISWXDIGIT])
203 REPLACE_WCTRANS=0; AC_SUBST([REPLACE_WCTRANS])
204 REPLACE_WCTYPE=0; AC_SUBST([REPLACE_WCTYPE])
200]) 205])
diff --git a/gl/m4/wint_t.m4 b/gl/m4/wint_t.m4
index dfd743b3..883fac28 100644
--- a/gl/m4/wint_t.m4
+++ b/gl/m4/wint_t.m4
@@ -1,5 +1,6 @@
1# wint_t.m4 serial 11 1# wint_t.m4
2dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. 2# serial 11
3dnl Copyright (C) 2003, 2007-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xalloc.m4 b/gl/m4/xalloc.m4
index fc56f59a..d44d0f08 100644
--- a/gl/m4/xalloc.m4
+++ b/gl/m4/xalloc.m4
@@ -1,5 +1,6 @@
1# xalloc.m4 serial 18 1# xalloc.m4
2dnl Copyright (C) 2002-2006, 2009-2023 Free Software Foundation, Inc. 2# serial 18
3dnl Copyright (C) 2002-2006, 2009-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/xsize.m4 b/gl/m4/xsize.m4
index 649db9c5..e5784973 100644
--- a/gl/m4/xsize.m4
+++ b/gl/m4/xsize.m4
@@ -1,5 +1,6 @@
1# xsize.m4 serial 5 1# xsize.m4
2dnl Copyright (C) 2003-2004, 2008-2023 Free Software Foundation, Inc. 2# serial 5
3dnl Copyright (C) 2003-2004, 2008-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.
diff --git a/gl/m4/zzgnulib.m4 b/gl/m4/zzgnulib.m4
index 362102b6..710fba4e 100644
--- a/gl/m4/zzgnulib.m4
+++ b/gl/m4/zzgnulib.m4
@@ -1,5 +1,6 @@
1# zzgnulib.m4 serial 1 1# zzgnulib.m4
2dnl Copyright (C) 2020-2023 Free Software Foundation, Inc. 2# serial 1
3dnl Copyright (C) 2020-2024 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation 4dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it, 5dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved. 6dnl with or without modifications, as long as this notice is preserved.