1178825Sdfrdnl $Id: need-proto.m4 14166 2004-08-26 12:35:42Z joda $ 255682Smarkmdnl 355682Smarkmdnl 455682Smarkmdnl Check if we need the prototype for a function 555682Smarkmdnl 655682Smarkm 755682Smarkmdnl AC_NEED_PROTO(includes, function) 855682Smarkm 9127808SnectarAC_DEFUN([AC_NEED_PROTO], [ 1055682Smarkmif test "$ac_cv_func_$2+set" != set -o "$ac_cv_func_$2" = yes; then 1155682SmarkmAC_CACHE_CHECK([if $2 needs a prototype], ac_cv_func_$2_noproto, 12178825SdfrAC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$1 13178825Sdfrstruct foo { int foo; } xx; 14178825Sdfrextern int $2 (struct foo*);]],[[$2(&xx)]])], 15178825Sdfr[eval "ac_cv_func_$2_noproto=yes"], 16178825Sdfr[eval "ac_cv_func_$2_noproto=no"])) 1755682Smarkmif test "$ac_cv_func_$2_noproto" = yes; then 18102644Snectar AC_DEFINE(AS_TR_CPP(NEED_[]$2[]_PROTO), 1, 19102644Snectar [define if the system is missing a prototype for $2()]) 2055682Smarkmfi 2155682Smarkmfi 2255682Smarkm]) 23