* lib/string.in.h (free, rpl_free): Consider GNULIB_FREE_POSIX variable.
* lib/wchar.in.h (free, rpl_free): Likewise.
* m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Require module
indicator variable initializations from the stdlib module.
* m4/wchar_h.m4 (gl_WCHAR_H_REQUIRE_DEFAULTS): Likewise.
* modules/string (Makefile.am): Substitute GNULIB_FREE_POSIX in string.h.
* modules/wchar (Makefile.am): Substitute GNULIB_FREE_POSIX in wchar.h.
+2021-09-18 Bruno Haible <bruno@clisp.org>
+
+ string, wchar: Don't cause link errors for rpl_free (regr. 2021-09-07).
+ * lib/string.in.h (free, rpl_free): Consider GNULIB_FREE_POSIX variable.
+ * lib/wchar.in.h (free, rpl_free): Likewise.
+ * m4/string_h.m4 (gl_STRING_H_REQUIRE_DEFAULTS): Require module
+ indicator variable initializations from the stdlib module.
+ * m4/wchar_h.m4 (gl_WCHAR_H_REQUIRE_DEFAULTS): Likewise.
+ * modules/string (Makefile.am): Substitute GNULIB_FREE_POSIX in string.h.
+ * modules/wchar (Makefile.am): Substitute GNULIB_FREE_POSIX in wchar.h.
+
2021-09-17 Bruno Haible <bruno@clisp.org>
threadlib: Avoid crashes in thread-related functions on Cygwin 3.2.0.
/* The definition of _GL_WARN_ON_USE is copied here. */
/* Declare 'free' if needed for _GL_ATTRIBUTE_DEALLOC_FREE. */
-#if (@REPLACE_FREE@ && !defined free \
- && !(defined __cplusplus && defined GNULIB_NAMESPACE))
_GL_EXTERN_C void free (void *);
-# define free rpl_free
-#endif
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+# define free rpl_free
_GL_EXTERN_C void free (void *);
+# endif
+#endif
/* Clear a block of memory. The compiler will not delete a call to
this function, even if the block is dead after the call. */
#endif
/* Declare 'free' if needed for _GL_ATTRIBUTE_DEALLOC_FREE. */
-#if (@REPLACE_FREE@ && !defined free \
- && !(defined __cplusplus && defined GNULIB_NAMESPACE))
_GL_EXTERN_C void free (void *);
-# define free rpl_free
-#endif
+#if @GNULIB_FREE_POSIX@
+# if (@REPLACE_FREE@ && !defined free \
+ && !(defined __cplusplus && defined GNULIB_NAMESPACE))
+# define free rpl_free
_GL_EXTERN_C void free (void *);
+# endif
+#endif
/* Convert a single-byte character to a wide character. */
#if @GNULIB_BTOWC@
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 32
+# serial 33
# Written by Paul Eggert.
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1])
])
m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
AC_REQUIRE([gl_STRING_H_DEFAULTS])
])
dnl Written by Eric Blake.
-# wchar_h.m4 serial 53
+# wchar_h.m4 serial 54
AC_DEFUN_ONCE([gl_WCHAR_H],
[
gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
])
m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS])
+ dnl Make sure the shell variable for GNULIB_FREE_POSIX is initialized.
+ m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
])
-e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
-e 's/@''GNULIB_MDA_MEMCCPY''@/$(GNULIB_MDA_MEMCCPY)/g' \
-e 's/@''GNULIB_MDA_STRDUP''@/$(GNULIB_MDA_STRDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \
< $(srcdir)/string.in.h | \
sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
-e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
-e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
-e 's/@''GNULIB_WCSFTIME''@/$(GNULIB_WCSFTIME)/g' \
-e 's/@''GNULIB_MDA_WCSDUP''@/$(GNULIB_MDA_WCSDUP)/g' \
+ -e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \
< $(srcdir)/wchar.in.h | \
sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
-e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \