summaryrefslogtreecommitdiff
path: root/src/system.h
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-11-12 17:19:21 +0000
committerJim Meyering <jim@meyering.net>1997-11-12 17:19:21 +0000
commitc0cc0c26ed0e459bba2889db858aa04cf3fcd6e9 (patch)
treebbb73ead1d3ac05e4ffb7ef2d7bcbdc12901aa9f /src/system.h
parentb74c9a14fdda36b4b47b29bb19ae4320d079c633 (diff)
downloadcoreutils-c0cc0c26ed0e459bba2889db858aa04cf3fcd6e9.tar.xz
[!HAVE_MEMPCPY] (mempcpy): Define.
Diffstat (limited to 'src/system.h')
-rw-r--r--src/system.h14
1 files changed, 14 insertions, 0 deletions
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