diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-17 22:45:56 +0100 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-17 22:45:56 +0100 |
commit | bb7cf2b64d2caf381249dda65ee0fe6766d9b3c6 (patch) | |
tree | 8f677d8de76d0bdbcd61ec347e926ad1bd325e3a /m4 | |
parent | 21ed6e8365e371b9088df727d0449133df58e9bc (diff) | |
download | gnulib-bb7cf2b64d2caf381249dda65ee0fe6766d9b3c6.tar.gz |
*printf-posix: ISO C 23: Add %b directive for binary output of integers.
* lib/printf-parse.c (PRINTF_PARSE): Recognize the 'b' directive.
* lib/printf-parse.h: Update comment.
* lib/wprintf-parse.h: Likewise.
* lib/vasnprintf.c (MAX_ROOM_NEEDED, VASNPRINTF): Add support for the
'b' directive.
* m4/printf.m4 (gl_PRINTF_DIRECTIVE_B): New macro.
* m4/vasnprintf.m4 (gl_PREREQ_VASNPRINTF_DIRECTIVE_B): New macro.
(gl_PREREQ_VASNPRINTF_WITH_EXTRAS): Invoke it.
* m4/vasnwprintf-posix.m4 (gl_FUNC_VASNWPRINTF_POSIX): Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_B.
* m4/dprintf-posix.m4 (gl_FUNC_DPRINTF_POSIX): Require
gl_PRINTF_DIRECTIVE_B and test its result. Invoke
gl_PREREQ_VASNPRINTF_DIRECTIVE_B.
* m4/fprintf-posix.m4 (gl_FUNC_FPRINTF_POSIX): Likewise.
* m4/obstack-printf-posix.m4 (gl_FUNC_OBSTACK_PRINTF_POSIX): Likewise.
* m4/snprintf-posix.m4 (gl_FUNC_SNPRINTF_POSIX): Likewise.
* m4/sprintf-posix.m4 (gl_FUNC_SPRINTF_POSIX): Likewise.
* m4/vasnprintf-posix.m4 (gl_FUNC_VASNPRINTF_POSIX): Likewise.
* m4/vasprintf-posix.m4 (gl_FUNC_VASPRINTF_POSIX): Likewise.
* m4/vdprintf-posix.m4 (gl_FUNC_VDPRINTF_POSIX): Likewise.
* m4/vfprintf-posix.m4 (gl_FUNC_VFPRINTF_POSIX): Likewise.
* m4/vsnprintf-posix.m4 (gl_FUNC_VSNPRINTF_POSIX): Likewise.
* m4/vsprintf-posix.m4 (gl_FUNC_VSPRINTF_POSIX): Likewise.
* tests/test-snprintf-posix.h (test_function): Add some tests of the %b
directive.
* tests/test-sprintf-posix.h (test_function): Likewise.
* tests/test-vasnprintf-posix.c (test_function): Likewise.
* tests/test-vasnwprintf-posix.c (test_function): Likewise.
* tests/test-vasprintf-posix.c (test_function): Likewise.
* doc/glibc-functions/asprintf.texi: Mention the 'b' directive.
* doc/glibc-functions/obstack_printf.texi: Likewise.
* doc/glibc-functions/obstack_vprintf.texi: Likewise.
* doc/glibc-functions/vasprintf.texi: Likewise.
* doc/posix-functions/dprintf.texi: Likewise.
* doc/posix-functions/fprintf.texi: Likewise.
* doc/posix-functions/fwprintf.texi: Likewise.
* doc/posix-functions/printf.texi: Likewise.
* doc/posix-functions/snprintf.texi: Likewise.
* doc/posix-functions/sprintf.texi: Likewise.
* doc/posix-functions/swprintf.texi: Likewise.
* doc/posix-functions/vdprintf.texi: Likewise.
* doc/posix-functions/vfprintf.texi: Likewise.
* doc/posix-functions/vfwprintf.texi: Likewise.
* doc/posix-functions/vprintf.texi: Likewise.
* doc/posix-functions/vsnprintf.texi: Likewise.
* doc/posix-functions/vsprintf.texi: Likewise.
* doc/posix-functions/vswprintf.texi: Likewise.
* doc/posix-functions/vwprintf.texi: Likewise.
* doc/posix-functions/wprintf.texi: Likewise.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/dprintf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/fprintf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/obstack-printf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/printf.m4 | 186 | ||||
-rw-r--r-- | m4/snprintf-posix.m4 | 42 | ||||
-rw-r--r-- | m4/sprintf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/vasnprintf-posix.m4 | 36 | ||||
-rw-r--r-- | m4/vasnprintf.m4 | 18 | ||||
-rw-r--r-- | m4/vasnwprintf-posix.m4 | 3 | ||||
-rw-r--r-- | m4/vasprintf-posix.m4 | 36 | ||||
-rw-r--r-- | m4/vdprintf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/vfprintf-posix.m4 | 32 | ||||
-rw-r--r-- | m4/vsnprintf-posix.m4 | 42 | ||||
-rw-r--r-- | m4/vsprintf-posix.m4 | 32 |
14 files changed, 358 insertions, 229 deletions
diff --git a/m4/dprintf-posix.m4 b/m4/dprintf-posix.m4 index a25ef4164e..4186ab70fe 100644 --- a/m4/dprintf-posix.m4 +++ b/m4/dprintf-posix.m4 @@ -1,4 +1,4 @@ -# dprintf-posix.m4 serial 3 +# dprintf-posix.m4 serial 4 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_DPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -33,27 +34,31 @@ AC_DEFUN([gl_FUNC_DPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # dprintf exists and is - # already POSIX compliant. - gl_cv_func_dprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # dprintf exists and is + # already POSIX compliant. + gl_cv_func_dprintf_posix=yes + ;; + esac ;; esac ;; @@ -88,6 +93,7 @@ AC_DEFUN([gl_FUNC_DPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/fprintf-posix.m4 b/m4/fprintf-posix.m4 index 3a51bcf4e1..5602000e4a 100644 --- a/m4/fprintf-posix.m4 +++ b/m4/fprintf-posix.m4 @@ -1,4 +1,4 @@ -# fprintf-posix.m4 serial 14 +# fprintf-posix.m4 serial 15 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_FPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -31,27 +32,31 @@ AC_DEFUN([gl_FUNC_FPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # fprintf exists and is - # already POSIX compliant. - gl_cv_func_fprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # fprintf exists and is + # already POSIX compliant. + gl_cv_func_fprintf_posix=yes + ;; + esac ;; esac ;; @@ -85,6 +90,7 @@ AC_DEFUN([gl_FUNC_FPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/obstack-printf-posix.m4 b/m4/obstack-printf-posix.m4 index 10f744c575..633b017442 100644 --- a/m4/obstack-printf-posix.m4 +++ b/m4/obstack-printf-posix.m4 @@ -1,4 +1,4 @@ -# obstack-printf-posix.m4 serial 4 +# obstack-printf-posix.m4 serial 5 dnl Copyright (C) 2008-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -14,6 +14,7 @@ AC_DEFUN([gl_FUNC_OBSTACK_PRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -36,27 +37,31 @@ AC_DEFUN([gl_FUNC_OBSTACK_PRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # obstack_printf exists and is - # already POSIX compliant. - gl_cv_func_obstack_printf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # obstack_printf exists and is + # already POSIX compliant. + gl_cv_func_obstack_printf_posix=yes + ;; + esac ;; esac ;; @@ -91,6 +96,7 @@ AC_DEFUN([gl_FUNC_OBSTACK_PRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/printf.m4 b/m4/printf.m4 index de98a870e9..719679c362 100644 --- a/m4/printf.m4 +++ b/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 74 +# printf.m4 serial 75 dnl Copyright (C) 2003, 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -603,6 +603,50 @@ int main () ]) ]) +dnl Test whether the *printf family of functions supports the 'b' conversion +dnl specifier for binary output of integers. +dnl (ISO C23) +dnl Result is gl_cv_func_printf_directive_b. + +AC_DEFUN([gl_PRINTF_DIRECTIVE_B], +[ + AC_REQUIRE([AC_PROG_CC]) + AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles + AC_CACHE_CHECK([whether printf supports the 'b' directive], + [gl_cv_func_printf_directive_b], + [ + AC_RUN_IFELSE( + [AC_LANG_SOURCE([[ +#include <stdio.h> +#include <string.h> +static char buf[100]; +int main () +{ + int result = 0; + if (sprintf (buf, "%b %d", 12345, 33, 44, 55) < 0 + || strcmp (buf, "11000000111001 33") != 0) + result |= 1; + return result; +}]])], + [gl_cv_func_printf_directive_b=yes], + [gl_cv_func_printf_directive_b=no], + [ + case "$host_os" in + # Guess no on glibc systems. + *-gnu* | gnu*) gl_cv_func_printf_directive_b="guessing no";; + # Guess no on musl systems. + *-musl* | midipix*) gl_cv_func_printf_directive_b="guessing no";; + # Guess no on Android. + linux*-android*) gl_cv_func_printf_directive_b="guessing no";; + # Guess no on native Windows. + mingw*) gl_cv_func_printf_directive_b="guessing no";; + # If we don't know, obey --enable-cross-guesses. + *) gl_cv_func_printf_directive_b="$gl_cross_guess_normal";; + esac + ]) + ]) +]) + dnl Test whether the *printf family of functions supports the %F format dnl directive. (ISO C99, POSIX:2001) dnl Result is gl_cv_func_printf_directive_f. @@ -1648,81 +1692,83 @@ dnl 2 = gl_PRINTF_LONG_DOUBLE dnl 3 = gl_PRINTF_INFINITE dnl 4 = gl_PRINTF_INFINITE_LONG_DOUBLE dnl 5 = gl_PRINTF_DIRECTIVE_A -dnl 6 = gl_PRINTF_DIRECTIVE_F -dnl 7 = gl_PRINTF_DIRECTIVE_N -dnl 8 = gl_PRINTF_DIRECTIVE_LS -dnl 9 = gl_PRINTF_POSITIONS -dnl 10 = gl_PRINTF_FLAG_GROUPING -dnl 11 = gl_PRINTF_FLAG_LEFTADJUST -dnl 12 = gl_PRINTF_FLAG_ZERO -dnl 13 = gl_PRINTF_PRECISION -dnl 14 = gl_PRINTF_ENOMEM -dnl 15 = gl_SNPRINTF_PRESENCE -dnl 16 = gl_SNPRINTF_TRUNCATION_C99 -dnl 17 = gl_SNPRINTF_RETVAL_C99 -dnl 18 = gl_SNPRINTF_DIRECTIVE_N -dnl 19 = gl_SNPRINTF_SIZE1 -dnl 20 = gl_VSNPRINTF_ZEROSIZE_C99 +dnl 6 = gl_PRINTF_DIRECTIVE_B +dnl 7 = gl_PRINTF_DIRECTIVE_F +dnl 8 = gl_PRINTF_DIRECTIVE_N +dnl 9 = gl_PRINTF_DIRECTIVE_LS +dnl 10 = gl_PRINTF_POSITIONS +dnl 11 = gl_PRINTF_FLAG_GROUPING +dnl 12 = gl_PRINTF_FLAG_LEFTADJUST +dnl 13 = gl_PRINTF_FLAG_ZERO +dnl 14 = gl_PRINTF_PRECISION +dnl 15 = gl_PRINTF_ENOMEM +dnl 16 = gl_SNPRINTF_PRESENCE +dnl 17 = gl_SNPRINTF_TRUNCATION_C99 +dnl 18 = gl_SNPRINTF_RETVAL_C99 +dnl 19 = gl_SNPRINTF_DIRECTIVE_N +dnl 20 = gl_SNPRINTF_SIZE1 +dnl 21 = gl_VSNPRINTF_ZEROSIZE_C99 dnl dnl 1 = checking whether printf supports size specifiers as in C99... dnl 2 = checking whether printf supports 'long double' arguments... dnl 3 = checking whether printf supports infinite 'double' arguments... dnl 4 = checking whether printf supports infinite 'long double' arguments... dnl 5 = checking whether printf supports the 'a' and 'A' directives... -dnl 6 = checking whether printf supports the 'F' directive... -dnl 7 = checking whether printf supports the 'n' directive... -dnl 8 = checking whether printf supports the 'ls' directive... -dnl 9 = checking whether printf supports POSIX/XSI format strings with positions... -dnl 10 = checking whether printf supports the grouping flag... -dnl 11 = checking whether printf supports the left-adjust flag correctly... -dnl 12 = checking whether printf supports the zero flag correctly... -dnl 13 = checking whether printf supports large precisions... -dnl 14 = checking whether printf survives out-of-memory conditions... -dnl 15 = checking for snprintf... -dnl 16 = checking whether snprintf truncates the result as in C99... -dnl 17 = checking whether snprintf returns a byte count as in C99... -dnl 18 = checking whether snprintf fully supports the 'n' directive... -dnl 19 = checking whether snprintf respects a size of 1... -dnl 20 = checking whether vsnprintf respects a zero size as in C99... +dnl 6 = checking whether printf supports the 'b' directive... +dnl 7 = checking whether printf supports the 'F' directive... +dnl 8 = checking whether printf supports the 'n' directive... +dnl 9 = checking whether printf supports the 'ls' directive... +dnl 10 = checking whether printf supports POSIX/XSI format strings with positions... +dnl 11 = checking whether printf supports the grouping flag... +dnl 12 = checking whether printf supports the left-adjust flag correctly... +dnl 13 = checking whether printf supports the zero flag correctly... +dnl 14 = checking whether printf supports large precisions... +dnl 15 = checking whether printf survives out-of-memory conditions... +dnl 16 = checking for snprintf... +dnl 17 = checking whether snprintf truncates the result as in C99... +dnl 18 = checking whether snprintf returns a byte count as in C99... +dnl 19 = checking whether snprintf fully supports the 'n' directive... +dnl 20 = checking whether snprintf respects a size of 1... +dnl 21 = checking whether vsnprintf respects a zero size as in C99... dnl dnl . = yes, # = no. dnl -dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 -dnl glibc 2.5 . . . . . . . . . . . . . . . . . . . . -dnl glibc 2.3.6 . . . . # . . . . . . . . . . . . . . . -dnl FreeBSD 13.0 . . . . # . . . . . . . . # . . . . . . -dnl FreeBSD 5.4, 6.1 . . . . # . . . . . . # . # . . . . . . -dnl Mac OS X 10.13.5 . . . # # . # . . . . . . . . . . # . . -dnl Mac OS X 10.5.8 . . . # # . . . . . . # . . . . . . . . -dnl Mac OS X 10.3.9 . . . . # . . . . . . # . # . . . . . . -dnl OpenBSD 6.0, 6.7 . . . . # . . . . . . . . # . . . . . . -dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . . . . . . -dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . -dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . -dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . -dnl Solaris 11.4 . . # # # . . # . . . # . . . . . . . . -dnl Solaris 11.3 . . . . # . . # . . . . . . . . . . . . -dnl Solaris 11.0 . . # # # . . # . . . # . . . . . . . . -dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . -dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . -dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # -dnl AIX 7.1 . . # # # . . . . . . # # . . . . . . . -dnl AIX 5.2 . . # # # . . . . . . # . . . . . . . . -dnl AIX 4.3.2, 5.1 # . # # # # . . . . . # . . . . # . . . -dnl HP-UX 11.31 . . . . # . . . . . . # . . . . # # . . -dnl HP-UX 11.{00,11,23} # . . . # # . . . . . # . . . . # # . # -dnl HP-UX 10.20 # . # . # # . ? . . # # . . . . # # ? # -dnl IRIX 6.5 # . # # # # . # . . . # . . . . # . . . -dnl OSF/1 5.1 # . # # # # . . . . . # . . . . # . . # -dnl OSF/1 4.0d # . # # # # . . . . . # . . # # # # # # -dnl NetBSD 9.0 . . . . # . . . . . . . . . . . . . . . -dnl NetBSD 5.0 . . . # # . . . . . . # . # . . . . . . -dnl NetBSD 4.0 . ? ? ? ? ? . ? . ? ? ? ? ? . . . ? ? ? -dnl NetBSD 3.0 . . . . # # . ? # # ? # . # . . . . . . -dnl Haiku . . . # # # . # . . . . . ? . . ? . . . -dnl BeOS # # . # # # . ? # . ? . # ? . . ? . . . -dnl Android 4.3 . . # # # # # # . # . # . # . . . # . . -dnl old mingw / msvcrt # # # # # # . . # # . # # ? . # # # . . -dnl MSVC 9 # # # # # # # . # # . # # ? # # # # . . -dnl mingw 2009-2011 . # . # . . . . # # . . . ? . . . . . . -dnl mingw-w64 2011 # # # # # # . . # # . # # ? . # # # . . +dnl 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 +dnl glibc 2.5 . . . . . # . . . . . . . . . . . . . . . +dnl glibc 2.3.6 . . . . # # . . . . . . . . . . . . . . . +dnl FreeBSD 13.0 . . . . # # . . . . . . . . # . . . . . . +dnl FreeBSD 5.4, 6.1 . . . . # # . . . . . . # . # . . . . . . +dnl Mac OS X 10.13.5 . . . # # # . # . . . . . . . . . . # . . +dnl Mac OS X 10.5.8 . . . # # # . . . . . . # . . . . . . . . +dnl Mac OS X 10.3.9 . . . . # # . . . . . . # . # . . . . . . +dnl OpenBSD 6.0, 6.7 . . . . # # . . . . . . . . # . . . . . . +dnl OpenBSD 3.9, 4.0 . . # # # # # . # . # . # . # . . . . . . +dnl Cygwin 1.7.0 (2009) . . . # . # . . ? . . . . . ? . . . . . . +dnl Cygwin 1.5.25 (2008) . . . # # # . . # . . . . . # . . . . . . +dnl Cygwin 1.5.19 (2006) # . . # # # # . # . # . # # # . . . . . . +dnl Solaris 11.4 . . # # # # . . # . . . # . . . . . . . . +dnl Solaris 11.3 . . . . # # . . # . . . . . . . . . . . . +dnl Solaris 11.0 . . # # # # . . # . . . # . . . . . . . . +dnl Solaris 10 . . # # # # . . # . . . # # . . . . . . . +dnl Solaris 2.6 ... 9 # . # # # # # . # . . . # # . . . # . . . +dnl Solaris 2.5.1 # . # # # # # . # . . . # . . # # # # # # +dnl AIX 7.1 . . # # # # . . . . . . # # . . . . . . . +dnl AIX 5.2 . . # # # # . . . . . . # . . . . . . . . +dnl AIX 4.3.2, 5.1 # . # # # # # . . . . . # . . . . # . . . +dnl HP-UX 11.31 . . . . # # . . . . . . # . . . . # # . . +dnl HP-UX 11.{00,11,23} # . . . # # # . . . . . # . . . . # # . # +dnl HP-UX 10.20 # . # . # # # . ? . . # # . . . . # # ? # +dnl IRIX 6.5 # . # # # # # . # . . . # . . . . # . . . +dnl OSF/1 5.1 # . # # # # # . . . . . # . . . . # . . # +dnl OSF/1 4.0d # . # # # # # . . . . . # . . # # # # # # +dnl NetBSD 9.0 . . . . # # . . . . . . . . . . . . . . . +dnl NetBSD 5.0 . . . # # # . . . . . . # . # . . . . . . +dnl NetBSD 4.0 . ? ? ? ? # ? . ? . ? ? ? ? ? . . . ? ? ? +dnl NetBSD 3.0 . . . . # # # . ? # # ? # . # . . . . . . +dnl Haiku . . . # # # # . # . . . . . ? . . ? . . . +dnl BeOS # # . # # # # . ? # . ? . # ? . . ? . . . +dnl Android 4.3 . . # # # # # # # . # . # . # . . . # . . +dnl old mingw / msvcrt # # # # # # # . . # # . # # ? . # # # . . +dnl MSVC 9 # # # # # # # # . # # . # # ? # # # # . . +dnl mingw 2009-2011 . # . # . # . . . # # . . . ? . . . . . . +dnl mingw-w64 2011 # # # # # # # . . # # . # # ? . # # # . . diff --git a/m4/snprintf-posix.m4 b/m4/snprintf-posix.m4 index 61a80a8aa8..033e1916e5 100644 --- a/m4/snprintf-posix.m4 +++ b/m4/snprintf-posix.m4 @@ -1,4 +1,4 @@ -# snprintf-posix.m4 serial 14 +# snprintf-posix.m4 serial 15 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_SNPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -38,37 +39,41 @@ AC_DEFUN([gl_FUNC_SNPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - case "$gl_cv_func_snprintf_truncation_c99" in + case "$gl_cv_func_printf_enomem" in *yes) - case "$gl_cv_func_snprintf_retval_c99" in + case "$gl_cv_func_snprintf_truncation_c99" in *yes) - case "$gl_cv_func_snprintf_directive_n" in + case "$gl_cv_func_snprintf_retval_c99" in *yes) - case "$gl_cv_func_snprintf_size1" in + case "$gl_cv_func_snprintf_directive_n" in *yes) - case "$gl_cv_func_vsnprintf_zerosize_c99" in + case "$gl_cv_func_snprintf_size1" in *yes) - # snprintf exists and is - # already POSIX compliant. - gl_cv_func_snprintf_posix=yes + case "$gl_cv_func_vsnprintf_zerosize_c99" in + *yes) + # snprintf exists and is + # already POSIX compliant. + gl_cv_func_snprintf_posix=yes + ;; + esac ;; esac ;; @@ -113,6 +118,7 @@ AC_DEFUN([gl_FUNC_SNPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/sprintf-posix.m4 b/m4/sprintf-posix.m4 index 9d9258e17a..cfcbe37cce 100644 --- a/m4/sprintf-posix.m4 +++ b/m4/sprintf-posix.m4 @@ -1,4 +1,4 @@ -# sprintf-posix.m4 serial 12 +# sprintf-posix.m4 serial 13 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_SPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -31,27 +32,31 @@ AC_DEFUN([gl_FUNC_SPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # sprintf exists and is - # already POSIX compliant. - gl_cv_func_sprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # sprintf exists and is + # already POSIX compliant. + gl_cv_func_sprintf_posix=yes + ;; + esac ;; esac ;; @@ -85,6 +90,7 @@ AC_DEFUN([gl_FUNC_SPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vasnprintf-posix.m4 b/m4/vasnprintf-posix.m4 index baf7cb437d..4983dfc50a 100644 --- a/m4/vasnprintf-posix.m4 +++ b/m4/vasnprintf-posix.m4 @@ -1,4 +1,4 @@ -# vasnprintf-posix.m4 serial 13 +# vasnprintf-posix.m4 serial 14 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VASNPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -32,29 +33,33 @@ AC_DEFUN([gl_FUNC_VASNPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - if test $ac_cv_func_vasnprintf = yes; then - # vasnprintf exists and is - # already POSIX compliant. - gl_cv_func_vasnprintf_posix=yes - fi + case "$gl_cv_func_printf_enomem" in + *yes) + if test $ac_cv_func_vasnprintf = yes; then + # vasnprintf exists and is + # already POSIX compliant. + gl_cv_func_vasnprintf_posix=yes + fi + ;; + esac ;; esac ;; @@ -88,6 +93,7 @@ AC_DEFUN([gl_FUNC_VASNPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vasnprintf.m4 b/m4/vasnprintf.m4 index cf451f9b03..b868aed08b 100644 --- a/m4/vasnprintf.m4 +++ b/m4/vasnprintf.m4 @@ -1,4 +1,4 @@ -# vasnprintf.m4 serial 40 +# vasnprintf.m4 serial 41 dnl Copyright (C) 2002-2004, 2006-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -182,6 +182,21 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_A], esac ]) +# Extra prerequisites of lib/vasnprintf.c for supporting the 'b' directive. +AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_B], +[ + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) + case "$gl_cv_func_printf_directive_b" in + *yes) + ;; + *) + AC_DEFINE([NEED_PRINTF_DIRECTIVE_B], [1], + [Define if the vasnprintf implementation needs special code for + the 'b' directive.]) + ;; + esac +]) + # Extra prerequisites of lib/vasnprintf.c for supporting the 'F' directive. AC_DEFUN([gl_PREREQ_VASNPRINTF_DIRECTIVE_F], [ @@ -308,6 +323,7 @@ AC_DEFUN([gl_PREREQ_VASNPRINTF_WITH_EXTRAS], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vasnwprintf-posix.m4 b/m4/vasnwprintf-posix.m4 index 9561bcf2b6..d9dc41fa97 100644 --- a/m4/vasnwprintf-posix.m4 +++ b/m4/vasnwprintf-posix.m4 @@ -1,4 +1,4 @@ -# vasnwprintf-posix.m4 serial 1 +# vasnwprintf-posix.m4 serial 2 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VASNWPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vasprintf-posix.m4 b/m4/vasprintf-posix.m4 index 7c198a6410..1537ad52d9 100644 --- a/m4/vasprintf-posix.m4 +++ b/m4/vasprintf-posix.m4 @@ -1,4 +1,4 @@ -# vasprintf-posix.m4 serial 13 +# vasprintf-posix.m4 serial 14 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -32,29 +33,33 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - if test $ac_cv_func_vasprintf = yes; then - # vasprintf exists and is - # already POSIX compliant. - gl_cv_func_vasprintf_posix=yes - fi + case "$gl_cv_func_printf_enomem" in + *yes) + if test $ac_cv_func_vasprintf = yes; then + # vasprintf exists and is + # already POSIX compliant. + gl_cv_func_vasprintf_posix=yes + fi + ;; + esac ;; esac ;; @@ -88,6 +93,7 @@ AC_DEFUN([gl_FUNC_VASPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vdprintf-posix.m4 b/m4/vdprintf-posix.m4 index 47914cd177..eb9ab8c679 100644 --- a/m4/vdprintf-posix.m4 +++ b/m4/vdprintf-posix.m4 @@ -1,4 +1,4 @@ -# vdprintf-posix.m4 serial 3 +# vdprintf-posix.m4 serial 4 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VDPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -33,27 +34,31 @@ AC_DEFUN([gl_FUNC_VDPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # vdprintf exists and is - # already POSIX compliant. - gl_cv_func_vdprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # vdprintf exists and is + # already POSIX compliant. + gl_cv_func_vdprintf_posix=yes + ;; + esac ;; esac ;; @@ -88,6 +93,7 @@ AC_DEFUN([gl_FUNC_VDPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vfprintf-posix.m4 b/m4/vfprintf-posix.m4 index ec68052214..17a8bad843 100644 --- a/m4/vfprintf-posix.m4 +++ b/m4/vfprintf-posix.m4 @@ -1,4 +1,4 @@ -# vfprintf-posix.m4 serial 14 +# vfprintf-posix.m4 serial 15 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VFPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -31,27 +32,31 @@ AC_DEFUN([gl_FUNC_VFPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # vfprintf exists and is - # already POSIX compliant. - gl_cv_func_vfprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # vfprintf exists and is + # already POSIX compliant. + gl_cv_func_vfprintf_posix=yes + ;; + esac ;; esac ;; @@ -85,6 +90,7 @@ AC_DEFUN([gl_FUNC_VFPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vsnprintf-posix.m4 b/m4/vsnprintf-posix.m4 index 5ea04a05e5..65805522d4 100644 --- a/m4/vsnprintf-posix.m4 +++ b/m4/vsnprintf-posix.m4 @@ -1,4 +1,4 @@ -# vsnprintf-posix.m4 serial 15 +# vsnprintf-posix.m4 serial 16 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VSNPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -39,37 +40,41 @@ AC_DEFUN([gl_FUNC_VSNPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - case "$gl_cv_func_snprintf_truncation_c99" in + case "$gl_cv_func_printf_enomem" in *yes) - case "$gl_cv_func_snprintf_retval_c99" in + case "$gl_cv_func_snprintf_truncation_c99" in *yes) - case "$gl_cv_func_snprintf_directive_n" in + case "$gl_cv_func_snprintf_retval_c99" in *yes) - case "$gl_cv_func_snprintf_size1" in + case "$gl_cv_func_snprintf_directive_n" in *yes) - case "$gl_cv_func_vsnprintf_zerosize_c99" in + case "$gl_cv_func_snprintf_size1" in *yes) - # vsnprintf exists and is - # already POSIX compliant. - gl_cv_func_vsnprintf_posix=yes + case "$gl_cv_func_vsnprintf_zerosize_c99" in + *yes) + # vsnprintf exists and is + # already POSIX compliant. + gl_cv_func_vsnprintf_posix=yes + ;; + esac ;; esac ;; @@ -114,6 +119,7 @@ AC_DEFUN([gl_FUNC_VSNPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING diff --git a/m4/vsprintf-posix.m4 b/m4/vsprintf-posix.m4 index 3ca0178ebd..716f58f761 100644 --- a/m4/vsprintf-posix.m4 +++ b/m4/vsprintf-posix.m4 @@ -1,4 +1,4 @@ -# vsprintf-posix.m4 serial 12 +# vsprintf-posix.m4 serial 13 dnl Copyright (C) 2007-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_VSPRINTF_POSIX], AC_REQUIRE([gl_PRINTF_INFINITE]) AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_A]) + AC_REQUIRE([gl_PRINTF_DIRECTIVE_B]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_F]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_N]) AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS]) @@ -31,27 +32,31 @@ AC_DEFUN([gl_FUNC_VSPRINTF_POSIX], *yes) case "$gl_cv_func_printf_directive_a" in *yes) - case "$gl_cv_func_printf_directive_f" in + case "$gl_cv_func_printf_directive_b" in *yes) - case "$gl_cv_func_printf_directive_n" in + case "$gl_cv_func_printf_directive_f" in *yes) - case "$gl_cv_func_printf_directive_ls" in + case "$gl_cv_func_printf_directive_n" in *yes) - case "$gl_cv_func_printf_positions" in + case "$gl_cv_func_printf_directive_ls" in *yes) - case "$gl_cv_func_printf_flag_grouping" in + case "$gl_cv_func_printf_positions" in *yes) - case "$gl_cv_func_printf_flag_leftadjust" in + case "$gl_cv_func_printf_flag_grouping" in *yes) - case "$gl_cv_func_printf_flag_zero" in + case "$gl_cv_func_printf_flag_leftadjust" in *yes) - case "$gl_cv_func_printf_precision" in + case "$gl_cv_func_printf_flag_zero" in *yes) - case "$gl_cv_func_printf_enomem" in + case "$gl_cv_func_printf_precision" in *yes) - # vsprintf exists and is - # already POSIX compliant. - gl_cv_func_vsprintf_posix=yes + case "$gl_cv_func_printf_enomem" in + *yes) + # vsprintf exists and is + # already POSIX compliant. + gl_cv_func_vsprintf_posix=yes + ;; + esac ;; esac ;; @@ -85,6 +90,7 @@ AC_DEFUN([gl_FUNC_VSPRINTF_POSIX], gl_PREREQ_VASNPRINTF_INFINITE_DOUBLE gl_PREREQ_VASNPRINTF_INFINITE_LONG_DOUBLE gl_PREREQ_VASNPRINTF_DIRECTIVE_A + gl_PREREQ_VASNPRINTF_DIRECTIVE_B gl_PREREQ_VASNPRINTF_DIRECTIVE_F gl_PREREQ_VASNPRINTF_DIRECTIVE_LS gl_PREREQ_VASNPRINTF_FLAG_GROUPING |