summaryrefslogtreecommitdiff
path: root/cross/avr-gdb/patches/patch-ad
blob: b98ea7115156925d44674b3cc4e32c23158f808c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
$NetBSD: patch-ad,v 1.1 2008/06/21 20:32:08 joerg Exp $

--- include/obstack.h.orig	2001-03-14 02:27:43.000000000 +0000
+++ include/obstack.h
@@ -417,14 +417,12 @@ __extension__								\
 /* These assume that the obstack alignment is good enough for pointers or ints,
    and that the data added so far to the current object
    shares that much alignment.  */
-
 # define obstack_ptr_grow(OBSTACK,datum)				\
 __extension__								\
 ({ struct obstack *__o = (OBSTACK);					\
    if (__o->next_free + sizeof (void *) > __o->chunk_limit)		\
      _obstack_newchunk (__o, sizeof (void *));				\
-   *((void **)__o->next_free)++ = ((void *)datum);			\
-   (void) 0; })
+   obstack_ptr_grow_fast (__o, datum); })
 
 # define obstack_int_grow(OBSTACK,datum)				\
 __extension__								\
@@ -434,7 +432,12 @@ __extension__								\
    *((int *)__o->next_free)++ = ((int)datum);				\
    (void) 0; })
 
-# define obstack_ptr_grow_fast(h,aptr) (*((void **) (h)->next_free)++ = (void *)aptr)
+# define obstack_ptr_grow_fast(OBSTACK,aptr)				\
+__extension__								\
+({ struct obstack *__o1 = (OBSTACK);					\
+   *(const void **) __o1->next_free = (aptr);				\
+   __o1->next_free += sizeof (const void *);				\
+   (void) 0; })
 # define obstack_int_grow_fast(h,aint) (*((int *) (h)->next_free)++ = (int) aint)
 
 # define obstack_blank(OBSTACK,length)					\