diff options
Diffstat (limited to 'gl/malloc.c')
| -rw-r--r-- | gl/malloc.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gl/malloc.c b/gl/malloc.c index a3095c17..908735d2 100644 --- a/gl/malloc.c +++ b/gl/malloc.c | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | /* malloc() function that is glibc compatible. | 1 | /* malloc() function that is glibc compatible. |
| 2 | 2 | ||
| 3 | Copyright (C) 1997-1998, 2006-2007, 2009-2010 Free Software Foundation, Inc. | 3 | Copyright (C) 1997-1998, 2006-2007, 2009-2013 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
| 6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
| @@ -13,26 +13,25 @@ | |||
| 13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
| 14 | 14 | ||
| 15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program; if not, write to the Free Software Foundation, | 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
| 17 | Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ | ||
| 18 | 17 | ||
| 19 | /* written by Jim Meyering and Bruno Haible */ | 18 | /* written by Jim Meyering and Bruno Haible */ |
| 20 | 19 | ||
| 20 | #define _GL_USE_STDLIB_ALLOC 1 | ||
| 21 | #include <config.h> | 21 | #include <config.h> |
| 22 | /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ | 22 | /* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h. */ |
| 23 | #ifdef malloc | 23 | #ifdef malloc |
| 24 | # define NEED_MALLOC_GNU | 24 | # define NEED_MALLOC_GNU 1 |
| 25 | # undef malloc | 25 | # undef malloc |
| 26 | /* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU. */ | ||
| 27 | #elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU | ||
| 28 | # define NEED_MALLOC_GNU 1 | ||
| 26 | #endif | 29 | #endif |
| 27 | 30 | ||
| 28 | /* Specification. */ | ||
| 29 | #include <stdlib.h> | 31 | #include <stdlib.h> |
| 30 | 32 | ||
| 31 | #include <errno.h> | 33 | #include <errno.h> |
| 32 | 34 | ||
| 33 | /* Call the system's malloc below. */ | ||
| 34 | #undef malloc | ||
| 35 | |||
| 36 | /* Allocate an N-byte block of memory from the heap. | 35 | /* Allocate an N-byte block of memory from the heap. |
| 37 | If N is zero, allocate a 1-byte block. */ | 36 | If N is zero, allocate a 1-byte block. */ |
| 38 | 37 | ||
| @@ -41,7 +40,7 @@ rpl_malloc (size_t n) | |||
| 41 | { | 40 | { |
| 42 | void *result; | 41 | void *result; |
| 43 | 42 | ||
| 44 | #ifdef NEED_MALLOC_GNU | 43 | #if NEED_MALLOC_GNU |
| 45 | if (n == 0) | 44 | if (n == 0) |
| 46 | n = 1; | 45 | n = 1; |
| 47 | #endif | 46 | #endif |
