X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fobstack.h;h=1bf4b2f1a666d07ee71dd7ac5026c32d94add895;hb=97020df1c106f5f06f2e06ca4d27c7c7dd878087;hp=95dd438ff7072b01a2cf5647f17a83b77a6d8fdd;hpb=0e56d268c07233446ac6171d32bf1a5a41fdbea0;p=gnulib.git diff --git a/lib/obstack.h b/lib/obstack.h index 95dd438ff..1bf4b2f1a 100644 --- a/lib/obstack.h +++ b/lib/obstack.h @@ -1,21 +1,20 @@ /* 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. - This program is free software; you can redistribute it and/or modify + 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 - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Summary: @@ -186,7 +185,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 +403,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 +501,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__ */