OSDN Git Service

gcc/ChangeLog
[pf3gnuchains/gcc-fork.git] / include / obstack.h
index 007853e..4aec3a4 100644 (file)
@@ -1,6 +1,6 @@
 /* obstack.h - object stack macros
    Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998,
-   1999, 2000
+   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
    Free Software Foundation, Inc.
 
 
@@ -19,7 +19,7 @@
 
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 
 /* Summary:
@@ -145,11 +145,7 @@ extern "C" {
 
 #if defined _LIBC || defined HAVE_STRING_H
 # include <string.h>
-# if defined __STDC__ && __STDC__
-#  define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
-# else
-#  define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
-# endif
+# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
 #else
 # ifdef memcpy
 #  define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
@@ -174,18 +170,12 @@ struct obstack            /* control current object in current chunk */
   char *chunk_limit;           /* address of char after current chunk */
   PTR_INT_TYPE temp;           /* Temporary for some macros.  */
   int   alignment_mask;                /* Mask of alignment for each object. */
-#if defined __STDC__ && __STDC__
   /* These prototypes vary based on `use_extra_arg', and we use
      casts to the prototypeless function type in all assignments,
      but having prototypes here quiets -Wstrict-prototypes.  */
   struct _obstack_chunk *(*chunkfun) (void *, long);
   void (*freefun) (void *, struct _obstack_chunk *);
   void *extra_arg;             /* first arg for chunk alloc/dealloc funcs */
-#else
-  struct _obstack_chunk *(*chunkfun) (); /* User's fcn to allocate a chunk.  */
-  void (*freefun) ();          /* User's function to free a chunk.  */
-  char *extra_arg;             /* first arg for chunk alloc/dealloc funcs */
-#endif
   unsigned use_extra_arg:1;    /* chunk alloc/dealloc funcs take extra arg */
   unsigned maybe_empty_object:1;/* There is a possibility that the current
                                   chunk contains a zero-length object.  This
@@ -198,7 +188,6 @@ struct obstack              /* control current object in current chunk */
 
 /* Declare the external functions we use; they are in obstack.c.  */
 
-#if defined __STDC__ && __STDC__
 extern void _obstack_newchunk (struct obstack *, int);
 extern void _obstack_free (struct obstack *, void *);
 extern int _obstack_begin (struct obstack *, int, int,
@@ -207,16 +196,7 @@ extern int _obstack_begin_1 (struct obstack *, int, int,
                             void *(*) (void *, long),
                             void (*) (void *, void *), void *);
 extern int _obstack_memory_used (struct obstack *);
-#else
-extern void _obstack_newchunk ();
-extern void _obstack_free ();
-extern int _obstack_begin ();
-extern int _obstack_begin_1 ();
-extern int _obstack_memory_used ();
-#endif
 \f
-#if defined __STDC__ && __STDC__
-
 /* Do the function-declarations after the structs
    but before defining the macros.  */
 
@@ -255,19 +235,10 @@ int obstack_alignment_mask (struct obstack *obstack);
 int obstack_chunk_size (struct obstack *obstack);
 int obstack_memory_used (struct obstack *obstack);
 
-#endif /* __STDC__ */
-
-/* Non-ANSI C cannot really support alternative functions for these macros,
-   so we do not declare them.  */
-
 /* Error handler called when `obstack_chunk_alloc' failed to allocate
    more memory.  This can be set to a user defined function.  The
    default action is to print a message and abort.  */
-#if defined __STDC__ && __STDC__
 extern void (*obstack_alloc_failed_handler) (void);
-#else
-extern void (*obstack_alloc_failed_handler) ();
-#endif
 
 /* Exit value used when `print_and_abort' is used.  */
 extern int obstack_exit_failure;
@@ -292,8 +263,6 @@ extern int obstack_exit_failure;
 
 /* To prevent prototype warnings provide complete argument list in
    standard C version.  */
-#if defined __STDC__ && __STDC__
-
 # define obstack_init(h) \
   _obstack_begin ((h), 0, 0, \
                  (void *(*) (long)) obstack_chunk_alloc, (void (*) (void *)) obstack_chunk_free)
@@ -317,32 +286,6 @@ extern int obstack_exit_failure;
 # define obstack_freefun(h, newfreefun) \
   ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun))
 
-#else
-
-# define obstack_init(h) \
-  _obstack_begin ((h), 0, 0, \
-                 (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_begin(h, size) \
-  _obstack_begin ((h), (size), 0, \
-                 (void *(*) ()) obstack_chunk_alloc, (void (*) ()) obstack_chunk_free)
-
-# define obstack_specify_allocation(h, size, alignment, chunkfun, freefun) \
-  _obstack_begin ((h), (size), (alignment), \
-                   (void *(*) ()) (chunkfun), (void (*) ()) (freefun))
-
-# define obstack_specify_allocation_with_arg(h, size, alignment, chunkfun, freefun, arg) \
-  _obstack_begin_1 ((h), (size), (alignment), \
-                   (void *(*) ()) (chunkfun), (void (*) ()) (freefun), (arg))
-
-# define obstack_chunkfun(h, newchunkfun) \
-  ((h) -> chunkfun = (struct _obstack_chunk *(*)()) (newchunkfun))
-
-# define obstack_freefun(h, newfreefun) \
-  ((h) -> freefun = (void (*)()) (newfreefun))
-
-#endif
-
 #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar))
 
 #define obstack_blank_fast(h,n) ((h)->next_free += (n))
@@ -584,23 +527,14 @@ __extension__                                                             \
     > (h)->chunk_limit - (char *) (h)->chunk)                          \
    ? ((h)->next_free = (h)->chunk_limit) : 0),                         \
   (h)->object_base = (h)->next_free,                                   \
-  __INT_TO_PTR ((h)->temp))
+  (void *) __INT_TO_PTR ((h)->temp))
 
-# if defined __STDC__ && __STDC__
-#  define obstack_free(h,obj)                                          \
+# define obstack_free(h,obj)                                           \
 ( (h)->temp = (char *) (obj) - (char *) (h)->chunk,                    \
   (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
    ? (int) ((h)->next_free = (h)->object_base                          \
            = (h)->temp + (char *) (h)->chunk)                          \
    : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
-# else
-#  define obstack_free(h,obj)                                          \
-( (h)->temp = (char *) (obj) - (char *) (h)->chunk,                    \
-  (((h)->temp > 0 && (h)->temp < (h)->chunk_limit - (char *) (h)->chunk)\
-   ? (int) ((h)->next_free = (h)->object_base                          \
-           = (h)->temp + (char *) (h)->chunk)                          \
-   : (_obstack_free ((h), (h)->temp + (char *) (h)->chunk), 0)))
-# endif
 
 #endif /* not __GNUC__ or not __STDC__ */