]> granicus.if.org Git - php/commitdiff
Use memrchr() instead of zend_memrchr() if available. (Nuno)
authorDmitry Stogov <dmitry@php.net>
Wed, 13 Feb 2008 16:22:01 +0000 (16:22 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 13 Feb 2008 16:22:01 +0000 (16:22 +0000)
Zend/zend_operators.h
configure.in

index 1bf25ee93e1e4684c5709d65347e60ddac59d68e..7be7b77596cc2f3851e7e59827c8db671399f2ba 100644 (file)
@@ -25,6 +25,7 @@
 #include <errno.h>
 #include <math.h>
 #include <assert.h>
+#include <string.h>
 
 #ifdef HAVE_IEEEFP_H
 #include <ieeefp.h>
@@ -239,6 +240,9 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
        return NULL;
 }
 
+#ifdef HAVE_MEMRCHR
+# define zend_memrchr(s,c,n) memrchr(s,c,n)
+#else
 static inline void *zend_memrchr(const void *s, int c, size_t n)
 {
        register unsigned char *e;
@@ -255,6 +259,7 @@ static inline void *zend_memrchr(const void *s, int c, size_t n)
 
        return NULL;
 }
+#endif
 
 BEGIN_EXTERN_C()
 ZEND_API int increment_function(zval *op1);
index e5dff11c713b12ab33dc70fc783cb3d9baf058a2..2c74e09935bfb0cd344fc7ca973a3d7565c5e2a5 100644 (file)
@@ -515,6 +515,7 @@ lchown \
 lrand48 \
 memcpy \
 memmove \
+memrchr \
 mkstemp \
 mmap \
 nl_langinfo \