Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:18677 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44812 invoked by uid 1010); 5 Sep 2005 13:07:54 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 44797 invoked from network); 5 Sep 2005 13:07:54 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Sep 2005 13:07:54 -0000 X-Host-Fingerprint: 216.117.147.250 unknown Linux 2.4/2.6 Received: from ([216.117.147.250:36027] helo=ctindustries.net) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id DC/0F-33268-9234C134 for ; Mon, 05 Sep 2005 09:07:54 -0400 Received: from [127.0.0.1] (dsta-aa203.pivot.net [66.186.171.203]) (authenticated bits=0) by ctindustries.net (8.12.8/8.12.8) with ESMTP id j85Bw5tI010099 for ; Mon, 5 Sep 2005 07:58:08 -0400 Message-ID: <431C449F.8040901@ctindustries.net> Date: Mon, 05 Sep 2005 09:14:07 -0400 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: "internals@lists.php.net" Content-Type: multipart/mixed; boundary="------------070005070003050603050300" X-Virus-Scanned: ClamAV 0.86.2/1063/Mon Sep 5 07:16:34 2005 on ctindustries.net X-Virus-Status: Clean Subject: building HEAD on windows From: rrichards@ctindustries.net (Rob Richards) --------------070005070003050603050300 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Attached is a patch to allow PHP 6 to build on windows (ext/string/string.c). MS compiler doesnt allow arithmetic operations on void *. This hopefully will work everywhere as I noticed some of these were changed before to support GCC 4. Rob --------------070005070003050603050300 Content-Type: text/plain; name="string.c.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="string.c.diff.txt" Index: string.c =================================================================== RCS file: /repository/php-src/ext/standard/string.c,v retrieving revision 1.476 diff -u -r1.476 string.c --- string.c 5 Sep 2005 10:55:35 -0000 1.476 +++ string.c 5 Sep 2005 13:05:02 -0000 @@ -5273,20 +5273,20 @@ if (haystack_type == IS_UNICODE) { while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) { /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */ - p += UBYTES(needle_len); + p = (UChar *)p + UBYTES(needle_len); count++; } } else { if (needle_len == 1) { cmp = ((char *)needle)[0]; - while ((p = memchr(p, cmp, endp - p))) { + while ((p = memchr(p, cmp, (char *)endp - (char *)p))) { count++; - (char *)p++; + p = (char *)p + 1; } } else { while ((p = php_memnstr((char *)p, (char *)needle, needle_len, (char *)endp))) { /*(char *)p += needle_len; // GCC 4.0.0 cannot compile this */ - p += needle_len; + p = (char *)p + needle_len; count++; } } @@ -5420,7 +5420,7 @@ } else { for (i = 0; i < left_pad; i++) *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len)); - memcpy(result + result_len, input, input_len); + memcpy((char *)result + result_len, input, input_len); result_len += input_len; for (i = 0; i < right_pad; i++) *((char *)result + result_len++) = *((char *)padstr + (i % padstr_len)); --------------070005070003050603050300--