summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libiberty/include/obstack.h
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2003-11-24 16:47:34 +0000
committerespie <espie@openbsd.org>2003-11-24 16:47:34 +0000
commit01e9b57fbaeda3f78fe9ec05b7fa83d05db4d7fb (patch)
treed0e1973b7f14164c04ff4f4f4a6c4e7303ae8726 /gnu/lib/libiberty/include/obstack.h
parentAnd the includes are taken from GCC 2.95.pre3 test3 (diff)
downloadwireguard-openbsd-01e9b57fbaeda3f78fe9ec05b7fa83d05db4d7fb.tar.xz
wireguard-openbsd-01e9b57fbaeda3f78fe9ec05b7fa83d05db4d7fb.zip
OpenBSD changes: synch somewhere between binutils-2.10 and 2.11
Support for mkstemps in choose-temp.
Diffstat (limited to 'gnu/lib/libiberty/include/obstack.h')
-rw-r--r--gnu/lib/libiberty/include/obstack.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/gnu/lib/libiberty/include/obstack.h b/gnu/lib/libiberty/include/obstack.h
index 38e96777660..a20ab55967a 100644
--- a/gnu/lib/libiberty/include/obstack.h
+++ b/gnu/lib/libiberty/include/obstack.h
@@ -143,12 +143,16 @@ extern "C" {
#if defined _LIBC || defined HAVE_STRING_H
# include <string.h>
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# 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
#else
# ifdef memcpy
-# define _obstack_memcpy(To, From, N) memcpy ((To), (From), (N))
+# define _obstack_memcpy(To, From, N) memcpy ((To), (char *)(From), (N))
# else
-# define _obstack_memcpy(To, From, N) bcopy ((From), (To), (N))
+# define _obstack_memcpy(To, From, N) bcopy ((char *)(From), (To), (N))
# endif
#endif
@@ -385,7 +389,7 @@ __extension__ \
int __len = (length); \
if (__o->next_free + __len > __o->chunk_limit) \
_obstack_newchunk (__o, __len); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
(void) 0; })
@@ -395,7 +399,7 @@ __extension__ \
int __len = (length); \
if (__o->next_free + __len + 1 > __o->chunk_limit) \
_obstack_newchunk (__o, __len + 1); \
- _obstack_memcpy (__o->next_free, (char *) (where), __len); \
+ _obstack_memcpy (__o->next_free, (where), __len); \
__o->next_free += __len; \
*(__o->next_free)++ = 0; \
(void) 0; })
@@ -510,14 +514,14 @@ __extension__ \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp)
# define obstack_grow0(h,where,length) \
( (h)->temp = (length), \
(((h)->next_free + (h)->temp + 1 > (h)->chunk_limit) \
? (_obstack_newchunk ((h), (h)->temp + 1), 0) : 0), \
- _obstack_memcpy ((h)->next_free, (char *) (where), (h)->temp), \
+ _obstack_memcpy ((h)->next_free, (where), (h)->temp), \
(h)->next_free += (h)->temp, \
*((h)->next_free)++ = 0)