This commit was manufactured by cvs2svn to create tag 'heimdal-0-7'.
[heimdal.git] / cf / broken-realloc.m4
blob078891559d38cf5d21151296b923eb5946aea65e
1 dnl
2 dnl $Id$
3 dnl
4 dnl Test for realloc that doesn't handle NULL as first parameter
5 dnl
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([[
10 #include <stddef.h>
11 #include <stdlib.h>
13 int main()
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))
24 #endif])