From: Paul Eggert Date: Mon, 4 Nov 2024 23:31:15 +0000 (-0800) Subject: realloc-posix: use _GL_USE_STDLIB_ALLOC X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=4f5e558f94add54790805ac10bfa4dbe076cc0b6;p=gnulib.git realloc-posix: use _GL_USE_STDLIB_ALLOC * lib/realloc.c (_GL_USE_STDLIB_ALLOC): New macro, which we can use now that we don’t use malloc. (realloc): Do not undef; no longer needed. --- diff --git a/ChangeLog b/ChangeLog index 761061e2b5..d646381a86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2024-11-04 Paul Eggert + realloc-posix: use _GL_USE_STDLIB_ALLOC + * lib/realloc.c (_GL_USE_STDLIB_ALLOC): + New macro, which we can use now that we don’t use malloc. + (realloc): Do not undef; no longer needed. + stdlib: make MB_CUR_MAX usable from extern inline * lib/stdlib.c: New file. * modules/stdlib (Files, lib_SOURCES): Add it. diff --git a/lib/realloc.c b/lib/realloc.c index 2f83b04dc9..e1c971eb06 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -18,6 +18,7 @@ /* written by Jim Meyering and Bruno Haible */ +#define _GL_USE_STDLIB_ALLOC 1 #include #include @@ -29,10 +30,6 @@ # include #endif -/* Call the system's realloc below. This file does not define - _GL_USE_STDLIB_ALLOC because it needs Gnulib's malloc if present. */ -#undef realloc - /* Change the size of an allocated block of memory P to N bytes, with error checking. If P is NULL, use malloc. Otherwise if N is zero, free P and return NULL. */