mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
ITS#6351,6390: s/memrchr/lutil_memrchr/, but try #define lutil_memrchr->memrchr
This commit is contained in:
parent
2de14c4ebc
commit
3aff1b0c0c
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user