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

ChangeLog
lib/rawmemchr.c

index 3e74dc576497f98719dcf0a2e6c818c6c35bafbb..3af98a992f5ec9c6e5a05567cc0cca572e0ac8b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-01-31  Bruno Haible  <bruno@clisp.org>
 
+       Make it possible to compile rawmemchr.c separately, unconditionally.
+       * lib/rawmemchr.c: Don't define rawmemchr if not needed.
+
        Make it possible to compile mempcpy.c separately, unconditionally.
        * lib/mempcpy.c: Don't define mempcpy if not needed.
 
index bbb250feb8c22e1f631e8babd23b57a2ca06d552..f4d50304b5236d2b6e29cda6bce1fa52962791e2 100644 (file)
@@ -19,6 +19,9 @@
 /* Specification.  */
 #include <string.h>
 
+/* A function definition is only needed if HAVE_RAWMEMCHR is not defined.  */
+#if !HAVE_RAWMEMCHR
+
 /* Find the first occurrence of C in S.  */
 void *
 rawmemchr (const void *s, int c_in)
@@ -134,3 +137,5 @@ rawmemchr (const void *s, int c_in)
     char_ptr++;
   return (void *) char_ptr;
 }
+
+#endif