1 dnl $Id: broken-snprintf.m4,v 1.3 1999/03/01 09:52:22 joda Exp $
3 AC_DEFUN(AC_BROKEN_SNPRINTF, [
4 AC_CACHE_CHECK(for working snprintf,ac_cv_func_snprintf_working,
5 ac_cv_func_snprintf_working=yes
14 snprintf(foo, 2, "12");
15 return strcmp(foo, "1");
16 }],:,ac_cv_func_snprintf_working=no,:))
18 if test "$ac_cv_func_snprintf_working" = yes; then
19 AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
21 if test "$ac_cv_func_snprintf_working" = yes; then
22 AC_NEED_PROTO([#include <stdio.h>],snprintf)
26 AC_DEFUN(AC_BROKEN_VSNPRINTF,[
27 AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
28 ac_cv_func_vsnprintf_working=yes
41 vsnprintf(bar, 2, "%s", arg);
43 return strcmp(bar, "1");
50 }],:,ac_cv_func_vsnprintf_working=no,:))
52 if test "$ac_cv_func_vsnprintf_working" = yes; then
53 AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
55 if test "$ac_cv_func_vsnprintf_working" = yes; then
56 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)