X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=m4%2Frealloc.m4;fp=m4%2Frealloc.m4;h=5925796864e033cb4e0794c9e751378f513b97c5;hb=c7e61475680fa226bd9b8bdd469cd66914e630f5;hp=0000000000000000000000000000000000000000;hpb=800deb09b422a73c1212233a93839a223ff59678;p=debian%2Fgzip diff --git a/m4/realloc.m4 b/m4/realloc.m4 new file mode 100644 index 0000000..5925796 --- /dev/null +++ b/m4/realloc.m4 @@ -0,0 +1,23 @@ +# realloc.m4 serial 9 +dnl Copyright (C) 2007, 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +# gl_FUNC_REALLOC_POSIX +# --------------------- +# Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it +# fails), and replace realloc if it is not. +AC_DEFUN([gl_FUNC_REALLOC_POSIX], +[ + AC_REQUIRE([gl_CHECK_MALLOC_POSIX]) + if test $gl_cv_func_malloc_posix = yes; then + HAVE_REALLOC_POSIX=1 + AC_DEFINE([HAVE_REALLOC_POSIX], [1], + [Define if the 'realloc' function is POSIX compliant.]) + else + AC_LIBOBJ([realloc]) + HAVE_REALLOC_POSIX=0 + fi + AC_SUBST([HAVE_REALLOC_POSIX]) +])