1 dnl $Id: broken-snprintf.m4,v 1.4.10.1 2004/04/01 07:27:32 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
12 snprintf(foo, 2, "12");
13 return strcmp(foo, "1");
14 }],:,ac_cv_func_snprintf_working=no,:))
16 if test "$ac_cv_func_snprintf_working" = yes; then
17 AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
19 if test "$ac_cv_func_snprintf_working" = yes; then
20 AC_NEED_PROTO([#include <stdio.h>],snprintf)
24 AC_DEFUN([AC_BROKEN_VSNPRINTF],[
25 AC_CACHE_CHECK(for working vsnprintf,ac_cv_func_vsnprintf_working,
26 ac_cv_func_vsnprintf_working=yes
37 vsnprintf(bar, 2, "%s", arg);
39 return strcmp(bar, "1");
46 }],:,ac_cv_func_vsnprintf_working=no,:))
48 if test "$ac_cv_func_vsnprintf_working" = yes; then
49 AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
51 if test "$ac_cv_func_vsnprintf_working" = yes; then
52 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)