>From a12d5bafef2103373e775683eba778c98f0142ce Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 Jan 2021 12:42:33 +0100 Subject: [PATCH 5/6] Make it possible to compile rawmemchr.c separately, unconditionally. * lib/rawmemchr.c: Don't define rawmemchr if not needed. --- ChangeLog | 3 +++ lib/rawmemchr.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3e74dc5..3af98a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2021-01-31 Bruno Haible + 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. diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c index bbb250f..f4d5030 100644 --- a/lib/rawmemchr.c +++ b/lib/rawmemchr.c @@ -19,6 +19,9 @@ /* Specification. */ #include +/* 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 -- 2.7.4