Duh - wrong diff.  This is what I get for doing too many things at once :).

The following compiles w/o trouble on Win32.


Index: ext/mbstring/mbstring.c
===================================================================
RCS file: /repository/php4/ext/mbstring/mbstring.c,v
retrieving revision 1.66
diff -u -b -r1.66 mbstring.c
--- ext/mbstring/mbstring.c     30 Apr 2002 12:00:42 -0000      1.66
+++ ext/mbstring/mbstring.c     30 Apr 2002 15:21:26 -0000
@@ -71,45 +71,34 @@
 #include "mbregex.h"
 #endif

-#if defined(HAVE_MBSTR_JA)
 static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
        mbfl_no_encoding_ascii,
+
+#if defined(HAVE_MBSTR_JA)
        mbfl_no_encoding_jis,
-       mbfl_no_encoding_utf8,
        mbfl_no_encoding_euc_jp,
-       mbfl_no_encoding_sjis
-};
+       mbfl_no_encoding_sjis,
 #endif

-
-#if defined(HAVE_MBSTR_CN) & !defined(HAVE_MBSTR_JA)
-static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
-       mbfl_no_encoding_ascii,
-       mbfl_no_encoding_utf8,
+#if defined(HAVE_MBSTR_CN)
        mbfl_no_encoding_euc_cn,
-       mbfl_no_encoding_cp936
-};
+       mbfl_no_encoding_cp936,
 #endif

-#if defined(HAVE_MBSTR_TW) & !defined(HAVE_MBSTR_JA)
-static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
-       mbfl_no_encoding_ascii,
-       mbfl_no_encoding_utf8,
+#if defined(HAVE_MBSTR_TW)
        mbfl_no_encoding_euc_tw,
-       mbfl_no_encoding_big5
-};
+       mbfl_no_encoding_big5,
 #endif

-#if defined(HAVE_MBSTR_KR) & !defined(HAVE_MBSTR_JA)
-static const enum mbfl_no_encoding php_mbstr_default_identify_list[] = {
-       mbfl_no_encoding_ascii,
-       mbfl_no_encoding_utf8,
+#if defined(HAVE_MBSTR_KR)
        mbfl_no_encoding_euc_kr,
-       mbfl_no_encoding_uhc
-};
+       mbfl_no_encoding_uhc,
 #endif

-static const int php_mbstr_default_identify_list_size = 
sizeof(php_mbstr_default_identify_list)/sizeof(enum mbfl_no_encoding);
+       mbfl_no_encoding_utf8
+};
+
+static const int php_mbstr_default_identify_list_size =
sizeof(php_mbstr_default_identify_list)/sizeof(php_mbstr_default_identify_list[0]);

 static unsigned char third_and_rest_force_ref[] = { 3, BYREF_NONE, BYREF_NONE, 
BYREF_FORCE_REST };
 static unsigned char second_args_force_ref[] = { 2, BYREF_NONE, BYREF_FORCE };

> -----Original Message-----
> From: Preston L. Bannister [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 30, 2002 7:21 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DEV] [PATCH] to get mbstring.c to compile
>
>
> The latest patch mbstring.c prevents PHP from compiling when none of the
> HAVE_MBSTR_* defines are present (which would be most sites!).  The code
> requires the php_mbstr_default_identify_list array must always be defined.
>
> Now as an English-only person I have no notion which values and ordering is
> correct.  Presumably someone with this knowledge can make the appropriate
> adjustments :).
>
> Although looking at this code, I suspect that the encodings chosen should be
> chosen not a compile time, but at run time.  There was a rather a lot of
> discussion in the Apache Jakarta mailing lists about encodings chosen on a
> per-request basis.
>
> In any case - this patch allows the code to compile anywhere.

[snipped wrong diff]

--
Preston L. Bannister
http://members.cox.net/preston.bannister/
pbannister on Yahoo Messenger


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to