Fixed gcc 4 compatibility

This commit is contained in:
Dmitry Stogov 2005-08-29 06:51:14 +00:00
parent 7c8af3ec49
commit a3b7eb2284

View File

@ -5272,7 +5272,8 @@ PHP_FUNCTION(substr_count)
if (haystack_type == IS_UNICODE) {
while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) {
(UChar *)p += needle_len;
/*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */
p += UBYTES(needle_len);
count++;
}
} else {
@ -5284,7 +5285,8 @@ PHP_FUNCTION(substr_count)
}
} else {
while ((p = php_memnstr((char *)p, (char *)needle, needle_len, (char *)endp))) {
(char *)p += needle_len;
/*(char *)p += needle_len; // GCC 4.0.0 cannot compile this */
p += needle_len;
count++;
}
}