2 dnl Copyright (C) 2002-2004, 2007-2020 Free Software Foundation, Inc.
3 dnl This file is free software; the Free Software Foundation
4 dnl gives unlimited permission to copy and/or distribute it,
5 dnl with or without modifications, as long as this notice is preserved.
7 dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
8 dnl but defers to any gnulib snprintf replacements. Therefore, gnulib
9 dnl must guarantee that the decision for replacing snprintf is a superset
10 dnl of the reasons checked by libintl.
11 AC_DEFUN([gl_FUNC_SNPRINTF],
13 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
14 gl_cv_func_snprintf_usable=no
15 AC_CHECK_FUNCS([snprintf])
16 if test $ac_cv_func_snprintf = yes; then
18 case "$gl_cv_func_snprintf_size1" in
20 gl_SNPRINTF_RETVAL_C99
21 case "$gl_cv_func_snprintf_retval_c99" in
24 case "$gl_cv_func_printf_positions" in
26 gl_cv_func_snprintf_usable=yes
34 if test $gl_cv_func_snprintf_usable = no; then
37 AC_CHECK_DECLS_ONCE([snprintf])
38 if test $ac_cv_have_decl_snprintf = no; then
43 AC_DEFUN([gl_REPLACE_SNPRINTF],
45 AC_REQUIRE([gl_STDIO_H_DEFAULTS])
47 if test $ac_cv_func_snprintf = yes; then
50 AC_CHECK_DECLS_ONCE([snprintf])
51 if test $ac_cv_have_decl_snprintf = yes; then
52 dnl If the function is declared but does not appear to exist, it may be
53 dnl defined as an inline function. In order to avoid a conflict, we have
54 dnl to define rpl_snprintf, not snprintf.
61 # Prerequisites of lib/snprintf.c.
62 AC_DEFUN([gl_PREREQ_SNPRINTF], [:])