+2024-11-06 Bruno Haible <bruno@clisp.org>
+
+ reallocarray: Fix compilation error in C++ mode (regr. 2024-11-04).
+ * m4/reallocarray.m4 (gl_FUNC_REALLOCARRAY): Don't use
+ REPLACE_REALLOC_FOR_REALLOC_POSIX here. Use gl_cv_malloc_ptrdiff
+ instead.
+
2024-11-05 Bruno Haible <bruno@clisp.org>
wmemset tests: Verify N3322 functionality.
# reallocarray.m4
-# serial 6
+# serial 7
dnl Copyright (C) 2017-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
AC_REQUIRE([gl_FUNC_REALLOC_0_NONNULL])
- REPLACE_REALLOCARRAY=$REPLACE_REALLOC_FOR_REALLOC_POSIX
gl_CHECK_FUNCS_ANDROID([reallocarray], [[#include <stdlib.h>]])
if test "$ac_cv_func_reallocarray" = no; then
HAVE_REALLOCARRAY=0
future*) REPLACE_REALLOCARRAY=1 ;;
esac
else
- case $gl_cv_func_realloc_0_nonnull in
+ if test "$gl_cv_malloc_ptrdiff" = no; then
+ REPLACE_REALLOCARRAY=1
+ fi
+ case "$gl_cv_func_realloc_0_nonnull" in
*yes) ;;
*) REPLACE_REALLOCARRAY=1 ;;
esac