]> Savannah Git Hosting - gnulib.git/commitdiff
Make it possible to compile mempcpy.c separately, unconditionally.
authorBruno Haible <bruno@clisp.org>
Sun, 31 Jan 2021 11:42:21 +0000 (12:42 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 31 Jan 2021 11:42:21 +0000 (12:42 +0100)
* lib/mempcpy.c: Don't define mempcpy if not needed.

ChangeLog
lib/mempcpy.c

index b8d5cd743c8401f4155e6411efaafada01bacb5f..3e74dc576497f98719dcf0a2e6c818c6c35bafbb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-01-31  Bruno Haible  <bruno@clisp.org>
 
+       Make it possible to compile mempcpy.c separately, unconditionally.
+       * lib/mempcpy.c: Don't define mempcpy if not needed.
+
        Make it possible to compile free.c separately, unconditionally.
        * m4/free.m4 (gl_FUNC_FREE): Define HAVE_FREE_POSIX.
        * lib/free.c: Don't define rpl_free if not needed.
index c61132e64a597d22aa98d4d7cec7e43ece3b2a89..6e9500c95ab6729892e4059f1770c985b7d5de88 100644 (file)
@@ -19,6 +19,9 @@
 /* Specification.  */
 #include <string.h>
 
+/* A function definition is only needed if HAVE_MEMPCPY is not defined.  */
+#if !HAVE_MEMPCPY
+
 /* Copy N bytes of SRC to DEST, return pointer to bytes after the
    last written byte.  */
 void *
@@ -26,3 +29,5 @@ mempcpy (void *dest, const void *src, size_t n)
 {
   return (char *) memcpy (dest, src, n) + n;
 }
+
+#endif