Blame gettext-tools/gnulib-m4/snprintf.m4

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