X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=lib%2Fstring.in.h;h=41e765cc2bb3bbd2d1572f84c7e1523796af299a;hp=5c7597cefb1e41b69c21723e001736e19fbe8933;hb=ec84142901fc685d7a08267fc0be8962e468968d;hpb=e72b57629bf49cdfd663002a8bb336a67b958979 diff --git a/lib/string.in.h b/lib/string.in.h index 5c7597ce..41e765cc 100644 --- a/lib/string.in.h +++ b/lib/string.in.h @@ -93,6 +93,22 @@ extern void *memrchr (void const *, int, size_t) memrchr (a, b, c)) #endif +/* Find the first occurrence of C in S. More efficient than + memchr(S,C,N), at the expense of undefined behavior if C does not + occur within N bytes. */ +#if @GNULIB_RAWMEMCHR@ +# if ! @HAVE_RAWMEMCHR@ +extern void *rawmemchr (void const *__s, int __c_in) + __attribute__ ((__pure__)); +# endif +#elif defined GNULIB_POSIXCHECK +# undef rawmemchr +# define rawmemchr(a,b) \ + (GL_LINK_WARNING ("rawmemchr is unportable - " \ + "use gnulib module rawmemchr for portability"), \ + rawmemchr (a, b)) +#endif + /* Copy SRC to DST, returning the address of the terminating '\0' in DST. */ #if @GNULIB_STPCPY@ # if ! @HAVE_STPCPY@