From: DJ Delorie Date: Fri, 25 Mar 2005 04:27:21 +0000 (+0000) Subject: merge from gcc X-Git-Tag: csl-arm-20050325-branchpoint~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51e32d644ad69408eacefacd21e015a6c9c519c2;p=external%2Fbinutils.git merge from gcc --- diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog index 0ab2ec9..231bab3 100644 --- a/libiberty/ChangeLog +++ b/libiberty/ChangeLog @@ -1,3 +1,7 @@ +2005-03-24 Kaveh R. Ghazi + + * xmemdup.c, xstrdup.c: Expose the tail call. + 2005-03-09 Mark Mitchell * configure.ac (funcs): Add gettimeofday. diff --git a/libiberty/xmemdup.c b/libiberty/xmemdup.c index 9e9d66b..0dae37d 100644 --- a/libiberty/xmemdup.c +++ b/libiberty/xmemdup.c @@ -24,6 +24,10 @@ allocated, the remaining memory is zeroed. #include /* For size_t. */ #ifdef HAVE_STRING_H #include +#else +# ifdef HAVE_STRINGS_H +# include +# endif #endif PTR @@ -33,6 +37,5 @@ xmemdup (input, copy_size, alloc_size) size_t alloc_size; { PTR output = xcalloc (1, alloc_size); - memcpy (output, input, copy_size); - return output; + return (PTR) memcpy (output, input, copy_size); } diff --git a/libiberty/xstrdup.c b/libiberty/xstrdup.c index 5aa084a..5ddd2e9 100644 --- a/libiberty/xstrdup.c +++ b/libiberty/xstrdup.c @@ -19,6 +19,10 @@ obtain memory. #endif #ifdef HAVE_STRING_H #include +#else +# ifdef HAVE_STRINGS_H +# include +# endif #endif #include "ansidecl.h" #include "libiberty.h" @@ -29,6 +33,5 @@ xstrdup (s) { register size_t len = strlen (s) + 1; register char *ret = xmalloc (len); - memcpy (ret, s, len); - return ret; + return (char *) memcpy (ret, s, len); }