X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=m4%2Fcalloc.m4;fp=m4%2Fcalloc.m4;h=3109fb26bfaf9569dea951c0e0bb628f3bbd8846;hb=20fcfc81ece044b8b0a6768ec6cf47be4e22a2e6;hp=c1ede8db3e70e666d98cbf387d74cfc8ea82d772;hpb=d57728a6ca2413a7c564d8b7bb13d9e5a5a180f3;p=debian%2Fgzip diff --git a/m4/calloc.m4 b/m4/calloc.m4 index c1ede8d..3109fb2 100644 --- a/m4/calloc.m4 +++ b/m4/calloc.m4 @@ -1,6 +1,6 @@ -# calloc.m4 serial 15 +# calloc.m4 serial 16 -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2016 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -25,10 +25,14 @@ AC_DEFUN([_AC_FUNC_CALLOC_IF], [AC_LANG_PROGRAM( [AC_INCLUDES_DEFAULT], [[int result = 0; - if (!calloc (0, 0)) + char *p = calloc (0, 0); + if (!p) result |= 1; - if (calloc ((size_t) -1 / 8 + 1, 8)) + free (p); + p = calloc ((size_t) -1 / 8 + 1, 8); + if (p) result |= 2; + free (p); return result; ]])], [ac_cv_func_calloc_0_nonnull=yes],