diff options
author | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
commit | 3a971fe69aad52dfd248901ae796e64a96ae3e37 (patch) | |
tree | ac7b5c62510ffa9f0316643bcb19a3fed3d5bef7 /crypto/heimdal/cf/broken-realloc.m4 | |
parent | 2934fc23653f64b32f4db32233d7eda11ca274f0 (diff) | |
parent | ebfe6dc471c206300fd82c7c0fd145f683aa52f6 (diff) | |
download | FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.zip FreeBSD-src-3a971fe69aad52dfd248901ae796e64a96ae3e37.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r72445,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/cf/broken-realloc.m4')
-rw-r--r-- | crypto/heimdal/cf/broken-realloc.m4 | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/crypto/heimdal/cf/broken-realloc.m4 b/crypto/heimdal/cf/broken-realloc.m4 new file mode 100644 index 0000000..1569255 --- /dev/null +++ b/crypto/heimdal/cf/broken-realloc.m4 @@ -0,0 +1,26 @@ +dnl +dnl $Id: broken-realloc.m4,v 1.1 2000/07/15 18:05:36 joda Exp $ +dnl +dnl Test for realloc that doesn't handle NULL as first parameter +dnl +AC_DEFUN(rk_BROKEN_REALLOC, [ +AC_CACHE_CHECK(if realloc if broken, ac_cv_func_realloc_broken, [ +ac_cv_func_realloc_broken=no +AC_TRY_RUN([ +#include <stddef.h> +#include <stdlib.h> + +int main() +{ + return realloc(NULL, 17) == NULL; +} +],:, ac_cv_func_realloc_broken=yes, :) +]) +if test "$ac_cv_func_realloc_broken" = yes ; then + AC_DEFINE(BROKEN_REALLOC, 1, [Define if realloc(NULL) doesn't work.]) +fi +AH_BOTTOM([#ifdef BROKEN_REALLOC +#define realloc(X, Y) isoc_realloc((X), (Y)) +#define isoc_realloc(X, Y) ((X) ? realloc((X), (Y)) : malloc(Y)) +#endif]) +]) |