]> 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:12 +0000 (16:22 +0000)
committerDmitry Stogov <dmitry@php.net>
Wed, 13 Feb 2008 16:22:12 +0000 (16:22 +0000)
Zend/zend_operators.h
configure.in

index 2e7c437de7bd3740b6de0a4043569decbeb6f37c..e9b7adafe31ab3a5e59e3cee5e220b4635369ee1 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <errno.h>
 #include <math.h>
+#include <string.h>
 
 #ifdef HAVE_IEEEFP_H
 #include <ieeefp.h>
@@ -250,6 +251,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;
@@ -266,6 +270,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 64d6f661962cf7fe15bcdc4f5fc4a19d053a8b70..01e41be1a341297785103c29507b2e40818ed5e7 100644 (file)
@@ -514,6 +514,7 @@ lchown \
 lrand48 \
 memcpy \
 memmove \
+memrchr \
 mkstemp \
 mmap \
 nl_langinfo \