X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Frealloc.c;h=0c96ffacbac0d575b1ee3007fa0436b06a34f8ad;hb=721f56dcf49f8f004f609cc966f876922faad1a8;hp=dc1adc9f7189187b1c29f1e4c1f9cb1f38167d86;hpb=2d4d7d9d00fe33b6f5291e00a30b6c1016775b74;p=gnulib.git diff --git a/lib/realloc.c b/lib/realloc.c index dc1adc9f7..0c96ffacb 100644 --- a/lib/realloc.c +++ b/lib/realloc.c @@ -1,6 +1,7 @@ /* realloc() function that is glibc compatible. - Copyright (C) 1997, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2011 Free Software + Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,36 +18,27 @@ /* written by Jim Meyering and Bruno Haible */ +#define _GL_USE_STDLIB_ALLOC 1 #include /* Only the AC_FUNC_REALLOC macro defines 'realloc' already in config.h. */ #ifdef realloc # define NEED_REALLOC_GNU 1 +/* Whereas the gnulib module 'realloc-gnu' defines HAVE_REALLOC_GNU. */ +#elif GNULIB_REALLOC_GNU && !HAVE_REALLOC_GNU +# define NEED_REALLOC_GNU 1 #endif /* Infer the properties of the system's malloc function. - Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ -#if GNULIB_MALLOC_GNU && !defined malloc + The gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */ +#if GNULIB_MALLOC_GNU && HAVE_MALLOC_GNU # define SYSTEM_MALLOC_GLIBC_COMPATIBLE 1 #endif -/* Below we want to call the system's malloc and realloc. - Undefine the symbols here so that including provides a - declaration of malloc(), not of rpl_malloc(), and likewise for realloc. */ -#undef malloc -#undef realloc - -/* Specification. */ #include #include -/* Below we want to call the system's malloc and realloc. - Undefine the symbols, if they were defined by gnulib's - replacement. */ -#undef malloc -#undef realloc - /* Change the size of an allocated block of memory P to N bytes, with error checking. If N is zero, change it to 1. If P is NULL, use malloc. */