* lib/string.in.h (memset_explicit): Consider REPLACE_MEMSET_EXPLICIT.
* m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize
REPLACE_MEMSET_EXPLICIT.
* modules/string (Makefile.am): Substitute REPLACE_MEMSET_EXPLICIT.
* m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Test for
memset_explicit using gl_CHECK_FUNCS_ANDROID instead of
AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_MEMSET_EXPLICIT.
* modules/memset_explicit (configure.ac): Consider
REPLACE_MEMSET_EXPLICIT.
* doc/posix-functions/memset_explicit.texi: Mention the Android API
levels.
Resolve conflicts for functions introduced in Android API level 34.
+ * lib/string.in.h (memset_explicit): Consider REPLACE_MEMSET_EXPLICIT.
+ * m4/string_h.m4 (gl_STRING_H_DEFAULTS): Initialize
+ REPLACE_MEMSET_EXPLICIT.
+ * modules/string (Makefile.am): Substitute REPLACE_MEMSET_EXPLICIT.
+ * m4/memset_explicit.m4 (gl_FUNC_MEMSET_EXPLICIT): Test for
+ memset_explicit using gl_CHECK_FUNCS_ANDROID instead of
+ AC_CHECK_FUNCS_ONCE. Conditionally set REPLACE_MEMSET_EXPLICIT.
+ * modules/memset_explicit (configure.ac): Consider
+ REPLACE_MEMSET_EXPLICIT.
+ * doc/posix-functions/memset_explicit.texi: Mention the Android API
+ levels.
+
* m4/freadahead.m4 (gl_FUNC_FREADAHEAD): Test for __freadahead using
gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE.
* lib/freadahead.h: Update comment.
@itemize
@item
This function is missing on some platforms:
-glibc 2.36, FreeBSD 13.1, NetBSD 9.3, OpenBSD 7.2, macOS 13, Solaris 11.4, Android 13,
+glibc 2.36, FreeBSD 13.1, NetBSD 9.3, OpenBSD 7.2, macOS 13, Solaris 11.4, Android API level 33,
and many other systems.
@end itemize
/* Overwrite a block of memory. The compiler will not optimize
effects away, even if the block is dead after the call. */
#if @GNULIB_MEMSET_EXPLICIT@
-# if ! @HAVE_MEMSET_EXPLICIT@
+# if @REPLACE_MEMSET_EXPLICIT@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# undef memset_explicit
+# define memset_explicit rpl_memset_explicit
+# endif
+_GL_FUNCDECL_RPL (memset_explicit, void *,
+ (void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (memset_explicit, void *, (void *__dest, int __c, size_t __n));
+# else
+# if !@HAVE_MEMSET_EXPLICIT@
_GL_FUNCDECL_SYS (memset_explicit, void *,
(void *__dest, int __c, size_t __n) _GL_ARG_NONNULL ((1)));
-# endif
+# endif
_GL_CXXALIAS_SYS (memset_explicit, void *, (void *__dest, int __c, size_t __n));
+# endif
_GL_CXXALIASWARN (memset_explicit);
#elif defined GNULIB_POSIXCHECK
# undef memset_explicit
+# memset_explicit.m4 serial 2
dnl Copyright 2022-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_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([memset_explicit])
+ gl_CHECK_FUNCS_ANDROID([memset_explicit], [[#include <string.h>]])
if test $ac_cv_func_memset_explicit = no; then
HAVE_MEMSET_EXPLICIT=0
+ case "$gl_cv_onwards_func_memset_explicit" in
+ future*) REPLACE_MEMSET_EXPLICIT=1 ;;
+ esac
fi
])
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 38
+# serial 39
# Written by Paul Eggert.
REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_MEMPCPY=0; AC_SUBST([REPLACE_MEMPCPY])
+ REPLACE_MEMSET_EXPLICIT=0; AC_SUBST([REPLACE_MEMSET_EXPLICIT])
REPLACE_STPCPY=0; AC_SUBST([REPLACE_STPCPY])
REPLACE_STPNCPY=0; AC_SUBST([REPLACE_STPNCPY])
REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
configure.ac:
gl_FUNC_MEMSET_EXPLICIT
-gl_CONDITIONAL([GL_COND_OBJ_MEMSET_EXPLICIT], [test $HAVE_MEMSET_EXPLICIT = 0])
+gl_CONDITIONAL([GL_COND_OBJ_MEMSET_EXPLICIT],
+ [test $HAVE_MEMSET_EXPLICIT = 0 || test $REPLACE_MEMSET_EXPLICIT = 1])
AM_COND_IF([GL_COND_OBJ_MEMSET_EXPLICIT], [
gl_PREREQ_MEMSET_EXPLICIT
])
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_MEMPCPY''@|$(REPLACE_MEMPCPY)|g' \
+ -e 's|@''REPLACE_MEMSET_EXPLICIT''@|$(REPLACE_MEMSET_EXPLICIT)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_STPCPY''@|$(REPLACE_STPCPY)|g' \
-e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \