From c0cc0c26ed0e459bba2889db858aa04cf3fcd6e9 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Wed, 12 Nov 1997 17:19:21 +0000 Subject: [!HAVE_MEMPCPY] (mempcpy): Define. --- src/system.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/system.h') diff --git a/src/system.h b/src/system.h index 34687e1a1..e60ee53fe 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 -- cgit v1.2.3-54-g00ecf