Debian Codegraph @

m4/vasprintf-posix.m4

raw
1 # vasprintf-posix.m4
2 # serial 21
3 dnl Copyright (C) 2007-2026 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.
7 dnl This file is offered as-is, without any warranty.
8
9 AC_DEFUN([gl_FUNC_VASPRINTF_POSIX],
10 [
11 AC_REQUIRE([gl_FUNC_VASPRINTF_IS_POSIX])
12 if test $gl_cv_func_vasprintf_posix = no; then
13 gl_PREREQ_VASNPRINTF_WITH_POSIX_EXTRAS
14 gl_REPLACE_VASNPRINTF
15 gl_REPLACE_VASPRINTF
16 fi
17 ])
18
19 dnl Test whether vasprintf exists and is POSIX compliant.
20 dnl Result is gl_cv_func_vasprintf_posix.
21 AC_DEFUN([gl_FUNC_VASPRINTF_IS_POSIX],
22 [
23 AC_REQUIRE([gl_PRINTF_SIZES_C99])
24 AC_REQUIRE([gl_PRINTF_SIZES_C23])
25 AC_REQUIRE([gl_PRINTF_LONG_DOUBLE])
26 AC_REQUIRE([gl_PRINTF_INFINITE])
27 AC_REQUIRE([gl_PRINTF_INFINITE_LONG_DOUBLE])
28 AC_REQUIRE([gl_PRINTF_DIRECTIVE_A])
29 AC_REQUIRE([gl_PRINTF_DIRECTIVE_B])
30 AC_REQUIRE([gl_PRINTF_DIRECTIVE_F])
31 m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],[AC_REQUIRE([gl_PRINTF_DIRECTIVE_N])])
32 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LS])
33 AC_REQUIRE([gl_PRINTF_DIRECTIVE_LC])
34 AC_REQUIRE([gl_PRINTF_POSITIONS])
35 AC_REQUIRE([gl_PRINTF_FLAG_GROUPING])
36 AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_INT_PRECISION])
37 AC_REQUIRE([gl_PRINTF_FLAG_GROUPING_MULTIBYTE])
38 AC_REQUIRE([gl_PRINTF_FLAG_LEFTADJUST])
39 AC_REQUIRE([gl_PRINTF_FLAG_ZERO])
40 AC_REQUIRE([gl_PRINTF_FLAG_ALT_PRECISION_ZERO])
41 AC_REQUIRE([gl_PRINTF_PRECISION])
42 AC_REQUIRE([gl_PRINTF_ENOMEM])
43 gl_cv_func_vasprintf_posix=no
44 AC_CHECK_FUNCS([vasprintf])
45 case "$gl_cv_func_printf_sizes_c99" in
46 *yes)
47 case "$gl_cv_func_printf_sizes_c23" in
48 *yes)
49 case "$gl_cv_func_printf_long_double" in
50 *yes)
51 case "$gl_cv_func_printf_infinite" in
52 *yes)
53 case "$gl_cv_func_printf_infinite_long_double" in
54 *yes)
55 case "$gl_cv_func_printf_directive_a" in
56 *yes)
57 case "$gl_cv_func_printf_directive_b" in
58 *yes)
59 case "$gl_cv_func_printf_directive_f" in
60 *yes)
61 case m4_ifdef([gl_PRINTF_SUPPORT_N_DIRECTIVE],["$gl_cv_func_printf_directive_n"],["yes"]) in
62 *yes)
63 case "$gl_cv_func_printf_directive_ls" in
64 *yes)
65 case "$gl_cv_func_printf_directive_lc" in
66 *yes)
67 case "$gl_cv_func_printf_positions" in
68 *yes)
69 case "$gl_cv_func_printf_flag_grouping" in
70 *yes)
71 case "$gl_cv_func_printf_flag_grouping_int_precision" in
72 *yes)
73 case "$gl_cv_func_printf_flag_grouping_multibyte" in
74 *yes)
75 case "$gl_cv_func_printf_flag_leftadjust" in
76 *yes)
77 case "$gl_cv_func_printf_flag_zero" in
78 *yes)
79 case "$gl_cv_func_printf_flag_alt_precision_zero" in
80 *yes)
81 case "$gl_cv_func_printf_precision" in
82 *yes)
83 case "$gl_cv_func_printf_enomem" in
84 *yes)
85 if test $ac_cv_func_vasprintf = yes; then
86 # vasprintf exists and is
87 # already POSIX compliant.
88 gl_cv_func_vasprintf_posix=yes
89 fi
90 ;;
91 esac
92 ;;
93 esac
94 ;;
95 esac
96 ;;
97 esac
98 ;;
99 esac
100 ;;
101 esac
102 ;;
103 esac
104 ;;
105 esac
106 ;;
107 esac
108 ;;
109 esac
110 ;;
111 esac
112 ;;
113 esac
114 ;;
115 esac
116 ;;
117 esac
118 ;;
119 esac
120 ;;
121 esac
122 ;;
123 esac
124 ;;
125 esac
126 ;;
127 esac
128 ;;
129 esac
130 ])