2 dnl $Heimdal: broken-realloc.m4 15435 2005-06-16 19:45:52Z lha $
5 dnl Test for realloc that doesn't handle NULL as first parameter
7 AC_DEFUN([rk_BROKEN_REALLOC], [
8 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
9 ac_cv_func_realloc_broken=no
10 AC_RUN_IFELSE([AC_LANG_SOURCE([[
14 int main(int argc, char **argv)
16 return realloc(NULL, 17) == NULL;
18 ]])],[:], [ac_cv_func_realloc_broken=yes],[:])
20 if test "$ac_cv_func_realloc_broken" = yes ; then
21 AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
23 AH_BOTTOM([#ifdef BROKEN_REALLOC
24 #define realloc(X, Y) rk_realloc((X), (Y))