vsnprintf.m4 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. # vsnprintf.m4 serial 6
  2. dnl Copyright (C) 2002-2004, 2007-2013 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.
  6. dnl Libintl 0.17 will replace vsnprintf only if it does not support %1$s,
  7. dnl but defers to any gnulib vsnprintf replacements. Therefore, gnulib
  8. dnl must guarantee that the decision for replacing vsnprintf is a superset
  9. dnl of the reasons checked by libintl.
  10. AC_DEFUN([gl_FUNC_VSNPRINTF],
  11. [
  12. AC_REQUIRE([gl_STDIO_H_DEFAULTS])
  13. gl_cv_func_vsnprintf_usable=no
  14. AC_CHECK_FUNCS([vsnprintf])
  15. if test $ac_cv_func_vsnprintf = yes; then
  16. gl_SNPRINTF_SIZE1
  17. case "$gl_cv_func_snprintf_size1" in
  18. *yes)
  19. gl_SNPRINTF_RETVAL_C99
  20. case "$gl_cv_func_snprintf_retval_c99" in
  21. *yes)
  22. gl_PRINTF_POSITIONS
  23. case "$gl_cv_func_printf_positions" in
  24. *yes)
  25. gl_cv_func_vsnprintf_usable=yes
  26. ;;
  27. esac
  28. ;;
  29. esac
  30. ;;
  31. esac
  32. fi
  33. if test $gl_cv_func_vsnprintf_usable = no; then
  34. gl_REPLACE_VSNPRINTF
  35. fi
  36. AC_CHECK_DECLS_ONCE([vsnprintf])
  37. if test $ac_cv_have_decl_vsnprintf = no; then
  38. HAVE_DECL_VSNPRINTF=0
  39. fi
  40. ])
  41. AC_DEFUN([gl_REPLACE_VSNPRINTF],
  42. [
  43. AC_REQUIRE([gl_STDIO_H_DEFAULTS])
  44. AC_LIBOBJ([vsnprintf])
  45. if test $ac_cv_func_vsnprintf = yes; then
  46. REPLACE_VSNPRINTF=1
  47. fi
  48. gl_PREREQ_VSNPRINTF
  49. ])
  50. # Prerequisites of lib/vsnprintf.c.
  51. AC_DEFUN([gl_PREREQ_VSNPRINTF], [:])