* lib/obstack.in.h (__obstack_free): Rename back from _obstack_free. This is for compatibility with glibc, which in turn is for compatibility with old Gnulib. All uses changed. --- ChangeLog | 5 +++++ lib/obstack.c | 4 +++- lib/obstack.in.h | 10 ++++++---- 3 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 3abdef82de..c73702402d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2025-05-05 Paul Eggert <egg...@cs.ucla.edu> + obstack: _obstack_free → __obstack_free + * lib/obstack.in.h (__obstack_free): Rename back from _obstack_free. + This is for compatibility with glibc, which in turn is for + compatibility with old Gnulib. All uses changed. + obstack: use glibc’s temp slot names * lib/obstack.in.h (struct obstack): Rename temp fields back to what glibc uses, to avoid any glibc concerns about source code diff --git a/lib/obstack.c b/lib/obstack.c index b5cf0d514b..9877207cb1 100644 --- a/lib/obstack.c +++ b/lib/obstack.c @@ -250,8 +250,10 @@ _obstack_allocated_p (struct obstack *h, void *obj) /* Free objects in obstack H, including OBJ and everything allocate more recently than OBJ. If OBJ is zero, free everything in H. */ +#undef obstack_free + void -_obstack_free (struct obstack *h, void *obj) +__obstack_free (struct obstack *h, void *obj) { struct _obstack_chunk *lp; /* below addr of any objects in this chunk */ struct _obstack_chunk *plp; /* point to previous chunk if any */ diff --git a/lib/obstack.in.h b/lib/obstack.in.h index a8f34ccfac..7d8a106448 100644 --- a/lib/obstack.in.h +++ b/lib/obstack.in.h @@ -235,14 +235,15 @@ struct obstack /* control current object in current chunk */ #if defined __GL_REPLACE_OBSTACK__ # define _obstack_newchunk rpl_obstack_newchunk -# define _obstack_free rpl_obstack_free +# define __obstack_free rpl_obstack_free # define _obstack_begin rpl_obstack_begin # define _obstack_begin_1 rpl_obstack_begin_1 # define _obstack_memory_used rpl_obstack_memory_used # define _obstack_allocated_p rpl_obstack_allocated_p +#elif !defined __obstack_free /* for old Gnulib */ +# define __obstack_free obstack_free #endif extern void _obstack_newchunk (struct obstack *, _OBSTACK_INDEX_T); -extern void _obstack_free (struct obstack *, void *); extern int _obstack_begin (struct obstack *, _OBSTACK_INDEX_T, _OBSTACK_INDEX_T, void *(*) (_OBSTACK_CHUNK_SIZE_T), @@ -253,6 +254,7 @@ extern int _obstack_begin_1 (struct obstack *, void (*) (void *, void *), void *); extern _OBSTACK_INDEX_T _obstack_memory_used (struct obstack *) __attribute_pure__; +extern void __obstack_free (struct obstack *, void *); /* Error handler called when 'obstack_chunk_alloc' failed to allocate @@ -473,7 +475,7 @@ extern int obstack_exit_failure; if (__obj > (void *) __o->chunk && __obj < (void *) __o->chunk_limit) \ __o->next_free = __o->object_base = (char *) __obj; \ else \ - _obstack_free (__o, __obj); }) + __obstack_free (__o, __obj); }) #else /* not __GNUC__ */ @@ -575,7 +577,7 @@ extern int obstack_exit_failure; (((h)->temp.tempptr > (void *) (h)->chunk \ && (h)->temp.tempptr < (void *) (h)->chunk_limit) \ ? (void) ((h)->next_free = (h)->object_base = (char *) (h)->temp.tempptr) \ - : _obstack_free ((h), (h)->temp.tempptr))) + : __obstack_free ((h), (h)->temp.tempptr))) #endif /* not __GNUC__ */ -- 2.49.0