snprintf.m4 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # snprintf.m4 serial 5
  2. dnl Copyright (C) 2002-2004, 2007-2010 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_cv_func_snprintf_usable=yes
  16. ;;
  17. esac
  18. fi
  19. if test $gl_cv_func_snprintf_usable = no; then
  20. gl_REPLACE_SNPRINTF
  21. fi
  22. AC_CHECK_DECLS_ONCE([snprintf])
  23. if test $ac_cv_have_decl_snprintf = no; then
  24. HAVE_DECL_SNPRINTF=0
  25. fi
  26. ])
  27. AC_DEFUN([gl_REPLACE_SNPRINTF],
  28. [
  29. AC_REQUIRE([gl_STDIO_H_DEFAULTS])
  30. AC_LIBOBJ([snprintf])
  31. if test $ac_cv_func_snprintf = yes; then
  32. REPLACE_SNPRINTF=1
  33. fi
  34. gl_PREREQ_SNPRINTF
  35. ])
  36. # Prerequisites of lib/snprintf.c.
  37. AC_DEFUN([gl_PREREQ_SNPRINTF], [:])