From: Bruno Haible Date: Sun, 31 Jan 2021 11:42:33 +0000 (+0100) Subject: Make it possible to compile rawmemchr.c separately, unconditionally. X-Git-Tag: v1.0~3109 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=a12d5bafef2103373e775683eba778c98f0142ce;p=gnulib.git Make it possible to compile rawmemchr.c separately, unconditionally. * lib/rawmemchr.c: Don't define rawmemchr if not needed. --- diff --git a/ChangeLog b/ChangeLog index 3e74dc5764..3af98a992f 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 bbb250feb8..f4d50304b5 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