about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-11-19 22:57:20 +0000
committerUlrich Drepper <drepper@redhat.com>1997-11-19 22:57:20 +0000
commit0982ec01496269c07052881626b11754e578ff07 (patch)
treec1f6c0be12eab539796da8aa6f4502ce3c410c26
parenta865a9eded616ea445f34289107029b5f68f24e1 (diff)
downloadglibc-0982ec01496269c07052881626b11754e578ff07.tar.gz
glibc-0982ec01496269c07052881626b11754e578ff07.tar.xz
glibc-0982ec01496269c07052881626b11754e578ff07.zip
(obstack_empty_p): New definition.
-rw-r--r--malloc/obstack.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/malloc/obstack.h b/malloc/obstack.h
index b60828b6ae..e7ae6959e5 100644
--- a/malloc/obstack.h
+++ b/malloc/obstack.h
@@ -104,8 +104,8 @@ Summary:
 
 /* Don't do the contents of this file more than once.  */
 
-#ifndef __OBSTACK_H__
-#define __OBSTACK_H__
+#ifndef _OBSTACK_H
+#define _OBSTACK_H 1
 
 #ifdef __cplusplus
 extern "C" {
@@ -379,6 +379,11 @@ __extension__								\
      _obstack_newchunk (__o, __len);					\
    (void) 0; })
 
+#define obstack_empty_p(OBSTACK)					\
+  __extension__								\
+  ({ struct obstack *__o = (OBSTACK);					\
+     (__o->chunk->prev == 0 && __o->next_free - __o->chunk->contents == 0); })
+
 #define obstack_grow(OBSTACK,where,length)				\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
@@ -492,6 +497,9 @@ __extension__								\
 #define obstack_room(h)		\
  (unsigned) ((h)->chunk_limit - (h)->next_free)
 
+#define obstack_empty_p(h) \
+ ((h)->chunk->prev == 0 && (h)->next_free - (h)->chunk->contents == 0)
+
 /* Note that the call to _obstack_newchunk is enclosed in (..., 0)
    so that we can avoid having void expressions
    in the arms of the conditional expression.
@@ -587,4 +595,4 @@ __extension__								\
 }	/* C++ */
 #endif
 
-#endif /* not __OBSTACK_H__ */
+#endif /* obstack.h */