[PATCH] to get mbstring.c to compile

From: Date: Tue, 30 Apr 2002 14:21:25 +0000
Subject: [PATCH] to get mbstring.c to compile
Groups: php.dev 
Request: Send a blank email to php-dev+get-83518@lists.php.net to get a copy of this message
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. 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 13:56:16 -0000 @@ -71,43 +71,32 @@ #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 -}; #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 -}; #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 -}; #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 -}; #endif + + mbfl_no_encoding_utf8 +}; static const int php_mbstr_default_identify_list_size = sizeof(php_mbstr_default_identify_list)/sizeof(enum mbfl_no_encoding); -- Preston L. Bannister preston.bannister@asg.com pbannister on Yahoo Messenger

« previous php.dev (#83518) next »