#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)
((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 { \
#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)
* 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;