Hello Bruno, * Bruno Haible wrote on Sun, Oct 28, 2007 at 04:20:42AM CET: > Ralf Wildenhues wrote: > > > > --- a/lib/realloc.c > > +++ b/lib/realloc.c > > @@ -23,6 +23,10 @@ > > # define NEED_REALLOC_GNU > > # undef realloc > > #endif > > +#ifdef malloc > > +# define NEED_REALLOC_GNU > > +# undef malloc > > +#endif > > > > This does not handle all possible cases right: > - If the module 'realloc' is used but the 'malloc' module is not, > and realloc(0) != NULL but malloc(0) == NULL, you also need > NEED_REALLOC_GNU. > - When the modules 'realloc-posix' and 'malloc' are used, but 'realloc' is > not, > there is no need to set NEED_REALLOC_GNU. > - NEED_REALLOC_GNU is overkill when realloc(0) != NULL but malloc(0) == > NULL. > Also, too few comments.
Pleading guilty on all accounts. :-) > How about this? Looks good to me, works in a casual test on Tru64 4.0D. Thanks! Ralf > 2007-10-27 Ralf Wildenhues <[EMAIL PROTECTED]> > Bruno Haible <[EMAIL PROTECTED]> > > * modules/malloc (configure.ac): Define GNULIB_MALLOC_GNU always. > * modules/realloc (configure.ac): Define GNULIB_REALLOC_GNU always. > * lib/realloc.c (SYSTEM_MALLOC_GLIBC_COMPATIBLE): New macro. > (malloc): Undefine also before including <stdlib.h>. > (rpl_realloc): Turn malloc(0) into malloc(1) if necessary. > Needed on OSF/1 4.0.