1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

malloc-h: Fix compilation errors in C++ mode on Android.

* lib/malloc.in.h: Don't include <stdlib.h>, except on Solaris and on
HP-UX. Include <stddef.h>. Make _GL_ATTRIBUTE_DEALLOC_FREE work (code
snippet copied from string.in.h and wchar.in.h).
* m4/malloc_h.m4 (gl_MALLOC_H_REQUIRE_DEFAULTS): Invoke
gl_STDLIB_H_REQUIRE_DEFAULTS.
* modules/malloc-h (Depends-on): Add stddef, stdlib.
(Makefile.am): Substitute GNULIB_FREE_POSIX and REPLACE_FREE.
This commit is contained in:
Bruno Haible
2023-01-09 13:47:25 +01:00
parent 25a5f3958d
commit 199566afec
4 changed files with 66 additions and 4 deletions

View File

@@ -10,6 +10,8 @@ gen-header
include_next
snippet/c++defs
snippet/warn-on-use
stddef
stdlib
configure.ac:
gl_MALLOC_H
@@ -29,8 +31,10 @@ malloc.h: malloc.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
-e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-e 's|@''NEXT_MALLOC_H''@|$(NEXT_MALLOC_H)|g' \
-e 's/@''GNULIB_FREE_POSIX''@/$(GNULIB_FREE_POSIX)/g' \
-e 's/@''GNULIB_MEMALIGN''@/$(GNULIB_MEMALIGN)/g' \
-e 's|@''HAVE_MEMALIGN''@|$(HAVE_MEMALIGN)|g' \
-e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
-e 's|@''REPLACE_MEMALIGN''@|$(REPLACE_MEMALIGN)|g' \
-e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \