]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - crypto/heimdal/cf/broken-realloc.m4
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / crypto / heimdal / cf / broken-realloc.m4
1 dnl
2 dnl $Id: broken-realloc.m4 15435 2005-06-16 19:45:52Z lha $
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>
12
13 int main(int argc, char **argv)
14 {
15         return realloc(NULL, 17) == NULL;
16 }
17 ]])],[:], [ac_cv_func_realloc_broken=yes],[:])
18 ])
19 if test "$ac_cv_func_realloc_broken" = yes ; then
20         AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.])
21 fi
22 AH_BOTTOM([#ifdef BROKEN_REALLOC
23 #define realloc(X, Y) rk_realloc((X), (Y))
24 #endif])
25 ])