From: Jim Meyering Date: Wed, 12 Nov 1997 17:19:21 +0000 (+0000) Subject: [!HAVE_MEMPCPY] (mempcpy): Define. X-Git-Tag: TEXTUTILS-1_22c~90 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c0cc0c26ed0e459bba2889db858aa04cf3fcd6e9;p=thirdparty%2Fcoreutils.git [!HAVE_MEMPCPY] (mempcpy): Define. --- diff --git a/src/system.h b/src/system.h index 34687e1a16..e60ee53fe8 100644 --- a/src/system.h +++ b/src/system.h @@ -405,3 +405,17 @@ char *strstr (); #endif #include "xalloc.h" + +#ifndef HAVE_MEMPCPY +# if defined (__GNUC__) +/* Use an inline function with GNU C so we don't get the warning that + `value computed is not used'. */ +static __inline__ void* +mempcpy (void *d, const void *s, size_t n) +{ + return (char *) memcpy (d, s, n) + n; +} +# else +# define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) +# endif +#endif