From 2234a524956f7a24cd5d1396f0773d0583a5cca9 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Fri, 21 May 2004 04:51:32 +0000
Subject: [PATCH] * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back
 this var.

---
 lib/ChangeLog | 7 +++++++
 lib/obstack.c | 7 +++++++
 2 files changed, 14 insertions(+)

diff --git a/lib/ChangeLog b/lib/ChangeLog
index 65dcb92681..a894cc13c4 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,10 @@
+2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
+	var.  Add comment explaining why libc still defines it.  This
+	merges the following patch from glibc:
+	http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
+
 2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* obstack.c (_obstack): Remove unused variable.  It hasn't been
diff --git a/lib/obstack.c b/lib/obstack.c
index 65e23e9d2e..52946d26de 100644
--- a/lib/obstack.c
+++ b/lib/obstack.c
@@ -102,6 +102,13 @@ int obstack_exit_failure = EXIT_FAILURE;
 #  define obstack_exit_failure exit_failure
 # endif
 
+# ifdef _LIBC
+/* A looong time ago (before 1994, anyway; we're not sure) this global variable
+   was used by non-GNU-C macros to avoid multiple evaluation.  The GNU C
+   library still exports it because somebody might use it.  */
+struct obstack *_obstack;
+# endif
+
 /* Define a macro that either calls functions with the traditional malloc/free
    calling interface, or calls functions with the mmalloc/mfree interface
    (that adds an extra first argument), based on the state of use_extra_arg.
-- 
2.39.5