Blame gnulib/m4/snprintf.m4

Packit eba2e2
# snprintf.m4 serial 6
Packit eba2e2
dnl Copyright (C) 2002-2004, 2007-2014 Free Software Foundation, Inc.
Packit eba2e2
dnl This file is free software; the Free Software Foundation
Packit eba2e2
dnl gives unlimited permission to copy and/or distribute it,
Packit eba2e2
dnl with or without modifications, as long as this notice is preserved.
Packit eba2e2
Packit eba2e2
dnl Libintl 0.17 will replace snprintf only if it does not support %1$s,
Packit eba2e2
dnl but defers to any gnulib snprintf replacements.  Therefore, gnulib
Packit eba2e2
dnl must guarantee that the decision for replacing snprintf is a superset
Packit eba2e2
dnl of the reasons checked by libintl.
Packit eba2e2
AC_DEFUN([gl_FUNC_SNPRINTF],
Packit eba2e2
[
Packit eba2e2
  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
Packit eba2e2
  gl_cv_func_snprintf_usable=no
Packit eba2e2
  AC_CHECK_FUNCS([snprintf])
Packit eba2e2
  if test $ac_cv_func_snprintf = yes; then
Packit eba2e2
    gl_SNPRINTF_SIZE1
Packit eba2e2
    case "$gl_cv_func_snprintf_size1" in
Packit eba2e2
      *yes)
Packit eba2e2
        gl_SNPRINTF_RETVAL_C99
Packit eba2e2
        case "$gl_cv_func_snprintf_retval_c99" in
Packit eba2e2
          *yes)
Packit eba2e2
            gl_PRINTF_POSITIONS
Packit eba2e2
            case "$gl_cv_func_printf_positions" in
Packit eba2e2
              *yes)
Packit eba2e2
                gl_cv_func_snprintf_usable=yes
Packit eba2e2
                ;;
Packit eba2e2
            esac
Packit eba2e2
            ;;
Packit eba2e2
        esac
Packit eba2e2
        ;;
Packit eba2e2
    esac
Packit eba2e2
  fi
Packit eba2e2
  if test $gl_cv_func_snprintf_usable = no; then
Packit eba2e2
    gl_REPLACE_SNPRINTF
Packit eba2e2
  fi
Packit eba2e2
  AC_CHECK_DECLS_ONCE([snprintf])
Packit eba2e2
  if test $ac_cv_have_decl_snprintf = no; then
Packit eba2e2
    HAVE_DECL_SNPRINTF=0
Packit eba2e2
  fi
Packit eba2e2
])
Packit eba2e2
Packit eba2e2
AC_DEFUN([gl_REPLACE_SNPRINTF],
Packit eba2e2
[
Packit eba2e2
  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
Packit eba2e2
  AC_LIBOBJ([snprintf])
Packit eba2e2
  if test $ac_cv_func_snprintf = yes; then
Packit eba2e2
    REPLACE_SNPRINTF=1
Packit eba2e2
  fi
Packit eba2e2
  gl_PREREQ_SNPRINTF
Packit eba2e2
])
Packit eba2e2
Packit eba2e2
# Prerequisites of lib/snprintf.c.
Packit eba2e2
AC_DEFUN([gl_PREREQ_SNPRINTF], [:])