3 dnl Copyright (C) 2007-2024 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 AC_DEFUN([gl_FUNC_VASNPRINTF_POSIX],
10 AC_REQUIRE([gl_FUNC_VASNPRINTF_IS_POSIX])
11 if test $gl_cv_func_vasnprintf_posix = no; then
12 gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
17 dnl Test whether vasnprintf exists and is POSIX compliant.
18 dnl Result is gl_cv_func_vasnprintf_posix.
19 AC_DEFUN_ONCE([gl_FUNC_VASNPRINTF_IS_POSIX],
21 AC_REQUIRE([gl_PRINTF_SIZES_C99])
22 AC_REQUIRE([gl_PRINTF_SIZES_C23])
23 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
24 AC_REQUIRE([gl_PRINTF_INFINITE])
25 AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
26 AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
27 AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
28 AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
29 m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],[AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])])
30 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
31 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
32 AC_REQUIRE([gl_PRINTF_POSITIONS])
33 AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
34 AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
35 AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
36 AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO])
37 AC_REQUIRE([gl_PRINTF_PRECISION])
38 AC_REQUIRE([gl_PRINTF_ENOMEM])
39 gl_cv_func_vasnprintf_posix=no
40 AC_CHECK_FUNCS_ONCE([vasnprintf])
41 case "$gl_cv_func_printf_sizes_c99" in
43 case "$gl_cv_func_printf_sizes_c23" in
45 case "$gl_cv_func_printf_long_double" in
47 case "$gl_cv_func_printf_infinite" in
49 case "$gl_cv_func_printf_infinite_long_double" in
51 case "$gl_cv_func_printf_directive_a" in
53 case "$gl_cv_func_printf_directive_b" in
55 case "$gl_cv_func_printf_directive_f" in
57 case m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],["$gl_cv_func_printf_directive_n"],["yes"]) in
59 case "$gl_cv_func_printf_directive_ls" in
61 case "$gl_cv_func_printf_directive_lc" in
63 case "$gl_cv_func_printf_positions" in
65 case "$gl_cv_func_printf_flag_grouping" in
67 case "$gl_cv_func_printf_flag_leftadjust" in
69 case "$gl_cv_func_printf_flag_zero" in
71 case "$gl_cv_func_printf_flag_alt_precision_zero" in
73 case "$gl_cv_func_printf_precision" in
75 case "$gl_cv_func_printf_enomem" in
77 if test $ac_cv_func_vasnprintf = yes; then
78 # vasnprintf exists and is
79 # already POSIX compliant.
80 gl_cv_func_vasnprintf_posix=yes