r10466: work around missing pread/pwrite declaration on openbsd
[samba.git] / source4 / lib / tdb / aclocal.m4
1 dnl see if a declaration exists for a function or variable
2 dnl defines HAVE_function_DECL if it exists
3 dnl AC_HAVE_DECL(var, includes)
4 AC_DEFUN(AC_HAVE_DECL,
5 [
6  AC_CACHE_CHECK([for $1 declaration],ac_cv_have_$1_decl,[
7     AC_TRY_COMPILE([$2],[int i = (int)$1],
8         ac_cv_have_$1_decl=yes,ac_cv_have_$1_decl=no)])
9  if test x"$ac_cv_have_$1_decl" = x"yes"; then
10     AC_DEFINE([HAVE_]translit([$1], [a-z], [A-Z])[_DECL],1,[Whether $1() is available])
11  fi
12 ])