+2025-05-06 Bruno Haible <bruno@clisp.org>
+
+ obstack: Fix library namespacing (regression yesterday).
+ * lib/obstack.in.h (__obstack_free): Define to _obstack_free, not
+ obstack_free, within glibc and in gnulib on systems without glibc.
+ * lib/obstack.c (obstack_free): Undefine only for the strong_alias.
+ (obstack_free): Define as an alias of _obstack_free, not vice versa.
+
2025-05-05 Paul Eggert <eggert@cs.ucla.edu>
obstack: match obstack.c with glibc
/* 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)
{
/* Older versions of libc used a function _obstack_free intended to be
called by non-GCC compilers. */
-strong_alias (obstack_free, _obstack_free)
+#undef obstack_free
+strong_alias (_obstack_free, obstack_free)
_OBSTACK_INDEX_T
_obstack_memory_used (struct obstack *h)
/* Declare the external functions we use; they are in obstack.c. */
-#if defined __GL_REPLACE_OBSTACK__
-# define _obstack_newchunk rpl_obstack_newchunk
-# 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
+#if defined __GL_GNULIB_HEADER
+/* Symbol mapping for gnulib. */
+# if defined __GL_REPLACE_OBSTACK__
+# define _obstack_newchunk rpl_obstack_newchunk
+# 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
+# else
+# define __obstack_free _obstack_free
+# endif
+#else
+/* Symbol mapping for glibc. */
+# define __obstack_free _obstack_free
#endif
+
extern void _obstack_newchunk (struct obstack *, _OBSTACK_INDEX_T);
extern int _obstack_begin (struct obstack *,
_OBSTACK_INDEX_T, _OBSTACK_INDEX_T,