remove gcc34
[dragonfly.git] / crypto / heimdal-0.6.3 / cf / broken-snprintf.m4
1 dnl $Id: broken-snprintf.m4,v 1.4.10.1 2004/04/01 07:27:32 joda Exp $
2 dnl
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
6 AC_TRY_RUN([
7 #include <stdio.h>
8 #include <string.h>
9 int main()
10 {
11         char foo[[3]];
12         snprintf(foo, 2, "12");
13         return strcmp(foo, "1");
14 }],:,ac_cv_func_snprintf_working=no,:))
15
16 if test "$ac_cv_func_snprintf_working" = yes; then
17         AC_DEFINE_UNQUOTED(HAVE_SNPRINTF, 1, [define if you have a working snprintf])
18 fi
19 if test "$ac_cv_func_snprintf_working" = yes; then
20 AC_NEED_PROTO([#include <stdio.h>],snprintf)
21 fi
22 ])
23
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
27 AC_TRY_RUN([
28 #include <stdio.h>
29 #include <string.h>
30 #include <stdarg.h>
31
32 int foo(int num, ...)
33 {
34         char bar[[3]];
35         va_list arg;
36         va_start(arg, num);
37         vsnprintf(bar, 2, "%s", arg);
38         va_end(arg);
39         return strcmp(bar, "1");
40 }
41
42
43 int main()
44 {
45         return foo(0, "12");
46 }],:,ac_cv_func_vsnprintf_working=no,:))
47
48 if test "$ac_cv_func_vsnprintf_working" = yes; then
49         AC_DEFINE_UNQUOTED(HAVE_VSNPRINTF, 1, [define if you have a working vsnprintf])
50 fi
51 if test "$ac_cv_func_vsnprintf_working" = yes; then
52 AC_NEED_PROTO([#include <stdio.h>],vsnprintf)
53 fi
54 ])