1 dnl $Heimdal: need-proto.m4 14166 2004-08-26 12:35:42Z joda $
5 dnl Check if we need the prototype for a function
8 dnl AC_NEED_PROTO(includes, function)
10 AC_DEFUN([AC_NEED_PROTO], [
11 if test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then
12 AC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto,
13 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1
14 struct foo { int foo; } xx;
15 extern int $2 (struct foo*);]],[[$2(&xx)]])],
16 [eval "ac_cv_func_$2_noproto=yes"],
17 [eval "ac_cv_func_$2_noproto=no"]))
18 if test "$ac_cv_func_$2_noproto" = yes; then
19 AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1,
20 [define if the system is missing a prototype for $2()])