ITS#6351,6390: s/memrchr/lutil_memrchr/, but try #define lutil_memrchr->memrchr

This commit is contained in:
Hallvard Furuseth 2009-11-20 20:43:50 +00:00
parent 2de14c4ebc
commit 3aff1b0c0c
3 changed files with 7 additions and 8 deletions

View File

@ -94,11 +94,10 @@ int (strncasecmp)();
#define memcmp lutil_memcmp
#endif
void *(lutil_memrchr)(const void *b, int c, size_t n);
/* GNU extension (glibc >= 2.1.91), only declared when defined(_GNU_SOURCE) */
#ifndef HAVE_MEMRCHR
#undef memrchr
#define memrchr lutil_memrchr
void * memrchr(const void *b, int c, size_t len);
#if defined(HAVE_MEMRCHR) && defined(_GNU_SOURCE)
#define lutil_memrchr(b, c, n) memrchr(b, c, n)
#endif /* ! HAVE_MEMRCHR */
#define STRLENOF(s) (sizeof(s)-1)

View File

@ -173,7 +173,7 @@ ber_bvarray_dup_x LDAP_P(( BerVarray *dst, BerVarray src, void *ctx ));
((char *) memchr( (bv)->bv_val, (c), (bv)->bv_len ))
#define ber_bvrchr(bv,c) \
((char *) memrchr( (bv)->bv_val, (c), (bv)->bv_len ))
((char *) lutil_memrchr( (bv)->bv_val, (c), (bv)->bv_len ))
#define ber_bvchr_post(dst,bv,c) \
do { \
@ -190,13 +190,13 @@ ber_bvarray_dup_x LDAP_P(( BerVarray *dst, BerVarray src, void *ctx ));
#define ber_bvrchr_post(dst,bv,c) \
do { \
(dst)->bv_val = memrchr( (bv)->bv_val, (c), (bv)->bv_len ); \
(dst)->bv_val = lutil_memrchr( (bv)->bv_val, (c), (bv)->bv_len ); \
(dst)->bv_len = (dst)->bv_val ? (bv)->bv_len - ((dst)->bv_val - (bv)->bv_val) : 0; \
} while (0)
#define ber_bvrchr_pre(dst,bv,c) \
do { \
(dst)->bv_val = memrchr( (bv)->bv_val, (c), (bv)->bv_len ); \
(dst)->bv_val = lutil_memrchr( (bv)->bv_val, (c), (bv)->bv_len ); \
(dst)->bv_len = (dst)->bv_val ? ((dst)->bv_val - (bv)->bv_val) : (bv)->bv_len; \
(dst)->bv_val = (bv)->bv_val; \
} while (0)

View File

@ -445,7 +445,7 @@ int closedir(DIR *dir)
* Memory Reverse Search
*/
void *
lutil_memrchr(const void *b, int c, size_t n)
(lutil_memrchr)(const void *b, int c, size_t n)
{
if (n != 0) {
const unsigned char *s, *bb = b, cc = c;