diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:47:29 +0000 |
commit | 4f5791ebd03eaec1c7da0865a383175b05102712 (patch) | |
tree | 8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/heimdal/cf/broken-realloc.m4 | |
parent | Initial commit. (diff) | |
download | samba-4f5791ebd03eaec1c7da0865a383175b05102712.tar.xz samba-4f5791ebd03eaec1c7da0865a383175b05102712.zip |
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/heimdal/cf/broken-realloc.m4')
-rw-r--r-- | third_party/heimdal/cf/broken-realloc.m4 | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/heimdal/cf/broken-realloc.m4 b/third_party/heimdal/cf/broken-realloc.m4 new file mode 100644 index 0000000..b6d962a --- /dev/null +++ b/third_party/heimdal/cf/broken-realloc.m4 @@ -0,0 +1,25 @@ +dnl +dnl $Id$ +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_RUN_IFELSE([AC_LANG_SOURCE([[ +#include <stddef.h> +#include <stdlib.h> + +int main(int argc, char **argv) +{ + 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) rk_realloc((X), (Y)) +#endif]) +]) |