]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
obstack: _obstack_free → __obstack_free
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 May 2025 21:02:17 +0000 (14:02 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 5 May 2025 21:16:21 +0000 (14:16 -0700)
* 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
lib/obstack.c
lib/obstack.in.h

index 3abdef82de088054269ea5cc46481cbc871aab4c..c73702402d45aab8af4481bf39795681b24c675a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2025-05-05  Paul Eggert  <eggert@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
index b5cf0d514b16856da11d6c88f5265ded955c9f90..9877207cb13d252861b015b5d29ef0429cfa71a1 100644 (file)
@@ -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 */
index a8f34ccfac28229c648c34681a44b3bf213600e3..7d8a106448377b845c86404f9ac452ff743b0509 100644 (file)
@@ -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__ */