Browse Source

add zend_memrchr()

PECL_OPENSSL
Antony Dovgal 20 years ago
parent
commit
b8617a6183
  1. 23
      Zend/zend_operators.h
  2. 1
      configure.in

23
Zend/zend_operators.h

@ -160,6 +160,29 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
return NULL;
}
#ifdef HAVE_MEMRCHR
# ifndef __USE_GNU
# define __USE_GNU
# endif
#include <string.h>
#define zend_memrchr memrchr
#else
static inline void *zend_memrchr(const void *s, int c, size_t n)
{
register unsigned char *e = (unsigned char *)s + n;
for (e--; e >= (unsigned char *)s; e--) {
if (*e == (unsigned char)c) {
return (void *)e;
}
}
return NULL;
}
#endif
BEGIN_EXTERN_C()
ZEND_API int increment_function(zval *op1);

1
configure.in

@ -491,6 +491,7 @@ lchown \
lrand48 \
memcpy \
memmove \
memrchr \
mkstemp \
mmap \
nl_langinfo \

Loading…
Cancel
Save