3 dnl Copyright (C) 2002-2004, 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 dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
9 dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
10 dnl must guarantee that the decision for replacing snprintf is a superset
11 dnl of the reasons checked by libintl.
12 AC_DEFUN([gl_FUNC_SNPRINTF],
14 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
15 gl_cv_func_snprintf_usable=no
16 AC_CHECK_FUNCS([snprintf])
17 if test $ac_cv_func_snprintf = yes; then
19 case "$gl_cv_func_snprintf_size1" in
21 gl_SNPRINTF_RETVAL_C99
22 case "$gl_cv_func_snprintf_retval_c99" in
25 case "$gl_cv_func_printf_positions" in
27 gl_cv_func_snprintf_usable=yes
35 if test $gl_cv_func_snprintf_usable = no; then
38 AC_CHECK_DECLS_ONCE([snprintf])
39 if test $ac_cv_have_decl_snprintf = no; then
44 AC_DEFUN([gl_REPLACE_SNPRINTF],
46 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
48 if test $ac_cv_func_snprintf = yes; then
51 AC_CHECK_DECLS_ONCE([snprintf])
52 if test $ac_cv_have_decl_snprintf = yes; then
53 dnl If the function is declared but does not appear to exist, it may be
54 dnl defined as an inline function. In order to avoid a conflict, we have
55 dnl to define rpl_snprintf, not snprintf.
62 # Prerequisites of lib/snprintf.c.
63 AC_DEFUN([gl_PREREQ_SNPRINTF], [:])