From: Bruno Haible Date: Mon, 23 Oct 2006 19:40:24 +0000 (+0000) Subject: Make it possible to rename obstack_free. X-Git-Tag: cvs-readonly~1668 X-Git-Url: http://erislabs.net/gitweb/?a=commitdiff_plain;h=9d55a02b1bba37b2a7a1f2c14f84a5c6a12ecbd1;p=gnulib.git Make it possible to rename obstack_free. --- diff --git a/ChangeLog b/ChangeLog index a9eb085c3..31406dbe4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,15 @@ 2006-10-23 Bruno Haible Paul Eggert + Ability to rename obstack_free. + * lib/obstack.h (__obstack_free): New macro. Declare instead of + obstack_free. + (obstack_free): Invoke the __obstack_free macro. + * lib/obstack.c (obstack_free): Use __obstack_free macro. + +2006-10-23 Bruno Haible + Paul Eggert + * lib/argp.h (argp_parse, __argp_parse): Comment out the identifiers __argc, __argv from the declaration. (They are defined as macros on mingw.) diff --git a/lib/obstack.c b/lib/obstack.c index 1bbf62bb6..5cd0b7a6d 100644 --- a/lib/obstack.c +++ b/lib/obstack.c @@ -342,7 +342,7 @@ _obstack_allocated_p (struct obstack *h, void *obj) # undef obstack_free void -obstack_free (struct obstack *h, void *obj) +__obstack_free (struct obstack *h, void *obj) { register struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ register struct _obstack_chunk *plp; /* point to previous chunk if any */ diff --git a/lib/obstack.h b/lib/obstack.h index 95dd438ff..3315dfe61 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -1,5 +1,5 @@ /* obstack.h - object stack macros - Copyright (C) 1988-1994,1996-1999,2003,2004,2005 + Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -186,7 +186,12 @@ extern int _obstack_begin_1 (struct obstack *, int, int, void (*) (void *, void *), void *); extern int _obstack_memory_used (struct obstack *); -void obstack_free (struct obstack *obstack, void *block); +/* The default name of the function for freeing a chunk is 'obstack_free', + but gnulib users can override this by defining '__obstack_free'. */ +#ifndef __obstack_free +# define __obstack_free obstack_free +#endif +extern void __obstack_free (struct obstack *obstack, void *block); /* Error handler called when `obstack_chunk_alloc' failed to allocate @@ -399,7 +404,7 @@ __extension__ \ void *__obj = (OBJ); \ if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit) \ __o->next_free = __o->object_base = (char *)__obj; \ - else (obstack_free) (__o, __obj); }) + else (__obstack_free) (__o, __obj); }) #else /* not __GNUC__ or not __STDC__ */ @@ -497,7 +502,7 @@ __extension__ \ && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk)) \ ? (int) ((h)->next_free = (h)->object_base \ = (h)->temp.tempint + (char *) (h)->chunk) \ - : (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) + : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0))) #endif /* not __GNUC__ or not __STDC__ */