bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: renaming obstack_free


From: Bruno Haible
Subject: Re: renaming obstack_free
Date: Mon, 23 Oct 2006 21:38:09 +0200
User-agent: KMail/1.9.1

Paul Eggert wrote:
> if we uniformly substitute __obstack_free for _obstack_free, and omit the
> change's last hunk, then the change should be OK for glibc.

Thanks for the advice. I committed this.


2006-10-23  Bruno Haible  <address@hidden>
            Paul Eggert  <address@hidden>

        Ability to rename obstack_free.
        * lib/obstack.h (__obstack_free): New macro. Declare instead of
        obstack_free.
        (obstack_free): Invoke the __obstack_free macro.
        * lib/obstack.c (obstack_free): Use __obstack_free macro.

diff -c -3 -r1.32 obstack.h
--- lib/obstack.h       14 Oct 2005 23:23:50 -0000      1.32
+++ lib/obstack.h       23 Oct 2006 19:36:52 -0000
@@ -1,5 +1,5 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988-1994,1996-1999,2003,2004,2005
+   Copyright (C) 1988-1994,1996-1999,2003,2004,2005,2006
        Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -186,7 +186,12 @@
                             void (*) (void *, void *), void *);
 extern int _obstack_memory_used (struct obstack *);
 
-void obstack_free (struct obstack *obstack, void *block);
+/* The default name of the function for freeing a chunk is 'obstack_free',
+   but gnulib users can override this by defining '__obstack_free'.  */
+#ifndef __obstack_free
+# define __obstack_free obstack_free
+#endif
+extern void __obstack_free (struct obstack *obstack, void *block);
 
  
 /* Error handler called when `obstack_chunk_alloc' failed to allocate
@@ -399,7 +404,7 @@
    void *__obj = (OBJ);                                                        
\
    if (__obj > (void *)__o->chunk && __obj < (void *)__o->chunk_limit)  \
      __o->next_free = __o->object_base = (char *)__obj;                        
\
-   else (obstack_free) (__o, __obj); })
+   else (__obstack_free) (__o, __obj); })
  
 #else /* not __GNUC__ or not __STDC__ */
 
@@ -497,7 +502,7 @@
     && (h)->temp.tempint < (h)->chunk_limit - (char *) (h)->chunk))    \
    ? (int) ((h)->next_free = (h)->object_base                          \
            = (h)->temp.tempint + (char *) (h)->chunk)                  \
-   : (((obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 0)))
+   : (((__obstack_free) ((h), (h)->temp.tempint + (char *) (h)->chunk), 0), 
0)))
 
 #endif /* not __GNUC__ or not __STDC__ */
 
diff -c -3 -r1.34 obstack.c
--- lib/obstack.c       13 Sep 2006 22:38:14 -0000      1.34
+++ lib/obstack.c       23 Oct 2006 19:36:52 -0000
@@ -342,7 +342,7 @@
 # undef obstack_free
 
 void
-obstack_free (struct obstack *h, void *obj)
+__obstack_free (struct obstack *h, void *obj)
 {
   register struct _obstack_chunk *lp;  /* below addr of any objects in this 
chunk */
   register struct _obstack_chunk *plp; /* point to previous chunk if any */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]