4 dnl Test for realloc that doesn't handle NULL as first parameter
6 AC_DEFUN([rk_BROKEN_REALLOC], [
7 AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [
8 ac_cv_func_realloc_broken=no
9 AC_RUN_IFELSE([AC_LANG_SOURCE([[
15 return realloc(NULL, 17) == NULL;
17 ]])],[:], [ac_cv_func_realloc_broken=yes],[:])
19 if test "$ac_cv_func_realloc_broken" = yes ; then
20 AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
22 AH_BOTTOM([#ifdef BROKEN_REALLOC
23 #define realloc(X, Y) rk_realloc((X), (Y))