snprintf.m4 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # snprintf.m4 serial 5
  2. dnl Copyright (C) 2002-2004, 2007-2011 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. AC_DEFUN([gl_FUNC_SNPRINTF],
  7. [
  8. AC_REQUIRE([gl_STDIO_H_DEFAULTS])
  9. gl_cv_func_snprintf_usable=no
  10. AC_CHECK_FUNCS([snprintf])
  11. if test $ac_cv_func_snprintf = yes; then
  12. gl_SNPRINTF_SIZE1
  13. case "$gl_cv_func_snprintf_size1" in
  14. *yes)
  15. gl_SNPRINTF_RETVAL_C99
  16. case "$gl_cv_func_snprintf_retval_c99" in
  17. *yes)
  18. gl_cv_func_snprintf_usable=yes
  19. ;;
  20. esac
  21. ;;
  22. esac
  23. fi
  24. if test $gl_cv_func_snprintf_usable = no; then
  25. gl_REPLACE_SNPRINTF
  26. fi
  27. AC_CHECK_DECLS_ONCE([snprintf])
  28. if test $ac_cv_have_decl_snprintf = no; then
  29. HAVE_DECL_SNPRINTF=0
  30. fi
  31. ])
  32. AC_DEFUN([gl_REPLACE_SNPRINTF],
  33. [
  34. AC_REQUIRE([gl_STDIO_H_DEFAULTS])
  35. AC_LIBOBJ([snprintf])
  36. if test $ac_cv_func_snprintf = yes; then
  37. REPLACE_SNPRINTF=1
  38. fi
  39. gl_PREREQ_SNPRINTF
  40. ])
  41. # Prerequisites of lib/snprintf.c.
  42. AC_DEFUN([gl_PREREQ_SNPRINTF], [:])