diff options
| author | Jani Taskinen <jani@php.net> | 2009-05-10 21:04:46 +0000 |
|---|---|---|
| committer | Jani Taskinen <jani@php.net> | 2009-05-10 21:04:46 +0000 |
| commit | 068d240da5f701edff38a2d9566c5b1420e1e8ca (patch) | |
| tree | 6980a343f5ef30d1af2f188dfbd22941a2850a53 /ext | |
| parent | 06000724e76e60842ef772025ea430844900e03e (diff) | |
| download | php-git-068d240da5f701edff38a2d9566c5b1420e1e8ca.tar.gz | |
- Fixed bug #48200 (compile failure with mbstring.c when --enable-zend-multibyte is used)
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/mbstring/mbstring.c | 23 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-02.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-03.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-04.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-05.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-06.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-07.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-08.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-09.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-10.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-11.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-12.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-13.phpt | 5 | ||||
| -rw-r--r-- | ext/mbstring/tests/zend_multibyte-14.phpt | 5 |
14 files changed, 52 insertions, 36 deletions
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c index 0d81eb00f9..ebd9afc3b6 100644 --- a/ext/mbstring/mbstring.c +++ b/ext/mbstring/mbstring.c @@ -94,8 +94,14 @@ /* {{{ prototypes */ ZEND_DECLARE_MODULE_GLOBALS(mbstring) + static PHP_GINIT_FUNCTION(mbstring); static PHP_GSHUTDOWN_FUNCTION(mbstring); + +static size_t php_mb_oddlen(const unsigned char *string, size_t length, const char *encoding TSRMLS_DC); +static int php_mb_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC); +static char* php_mb_encoding_detector(const unsigned char *arg_string, size_t arg_length, char *arg_list TSRMLS_DC); +static int php_mb_set_zend_encoding(TSRMLS_D); /* }}} */ /* {{{ php_mb_default_identify_list */ @@ -866,7 +872,7 @@ static void _php_mb_free_regex(void *opaque); #if HAVE_ONIG /* {{{ _php_mb_compile_regex */ -void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) +static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) { php_mb_regex_t *retval; OnigErrorInfo err_info; @@ -887,7 +893,7 @@ void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) /* }}} */ /* {{{ _php_mb_match_regex */ -int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) +static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) { return onig_search((php_mb_regex_t *)opaque, (const OnigUChar *)str, (const OnigUChar*)str + str_len, (const OnigUChar *)str, @@ -896,14 +902,14 @@ int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) /* }}} */ /* {{{ _php_mb_free_regex */ -void _php_mb_free_regex(void *opaque) +static void _php_mb_free_regex(void *opaque) { onig_free((php_mb_regex_t *)opaque); } /* }}} */ #elif HAVE_PCRE || HAVE_BUNDLED_PCRE /* {{{ _php_mb_compile_regex */ -void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) +static void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) { pcre *retval; const char *err_str; @@ -918,7 +924,7 @@ void *_php_mb_compile_regex(const char *pattern TSRMLS_DC) /* }}} */ /* {{{ _php_mb_match_regex */ -int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) +static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) { return pcre_exec((pcre *)opaque, NULL, str, (int)str_len, 0, 0, NULL, 0) >= 0; @@ -926,7 +932,7 @@ int _php_mb_match_regex(void *opaque, const char *str, size_t str_len) /* }}} */ /* {{{ _php_mb_free_regex */ -void _php_mb_free_regex(void *opaque) +static void _php_mb_free_regex(void *opaque) { pcre_free(opaque); } @@ -4720,7 +4726,6 @@ MBSTRING_API int php_mb_stripos(int mode, const char *old_haystack, unsigned int /* }}} */ #ifdef ZEND_MULTIBYTE - /* {{{ php_mb_set_zend_encoding() */ static int php_mb_set_zend_encoding(TSRMLS_D) { @@ -4812,9 +4817,7 @@ static char* php_mb_encoding_detector(const unsigned char *arg_string, size_t ar /* }}} */ /* {{{ int php_mb_encoding_converter() */ -static int php_mb_encoding_converter(unsigned char **to, size_t *to_length, - const unsigned char *from, size_t from_length, - const char *encoding_to, const char *encoding_from TSRMLS_DC) +static int php_mb_encoding_converter(unsigned char **to, size_t *to_length, const unsigned char *from, size_t from_length, const char *encoding_to, const char *encoding_from TSRMLS_DC) { mbfl_string string, result, *ret; enum mbfl_no_encoding from_encoding, to_encoding; diff --git a/ext/mbstring/tests/zend_multibyte-02.phpt b/ext/mbstring/tests/zend_multibyte-02.phpt index c613a722b5..c94dee5a28 100644 --- a/ext/mbstring/tests/zend_multibyte-02.phpt +++ b/ext/mbstring/tests/zend_multibyte-02.phpt @@ -2,9 +2,10 @@ zend multibyte (2) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=UTF-8 diff --git a/ext/mbstring/tests/zend_multibyte-03.phpt b/ext/mbstring/tests/zend_multibyte-03.phpt index 02baaa8d70..46a262c32e 100644 --- a/ext/mbstring/tests/zend_multibyte-03.phpt +++ b/ext/mbstring/tests/zend_multibyte-03.phpt @@ -2,9 +2,10 @@ zend multibyte (3) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=UTF-8 diff --git a/ext/mbstring/tests/zend_multibyte-04.phpt b/ext/mbstring/tests/zend_multibyte-04.phpt index 1ae8dfea94..f1295b6afe 100644 --- a/ext/mbstring/tests/zend_multibyte-04.phpt +++ b/ext/mbstring/tests/zend_multibyte-04.phpt @@ -2,9 +2,10 @@ zend multibyte (4) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=CP932 diff --git a/ext/mbstring/tests/zend_multibyte-05.phpt b/ext/mbstring/tests/zend_multibyte-05.phpt index b61bd05902..0a01c231fc 100644 --- a/ext/mbstring/tests/zend_multibyte-05.phpt +++ b/ext/mbstring/tests/zend_multibyte-05.phpt @@ -2,9 +2,10 @@ zend multibyte (5) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=EUC-JP diff --git a/ext/mbstring/tests/zend_multibyte-06.phpt b/ext/mbstring/tests/zend_multibyte-06.phpt index a6f4bbbf77..9acd6a951d 100644 --- a/ext/mbstring/tests/zend_multibyte-06.phpt +++ b/ext/mbstring/tests/zend_multibyte-06.phpt @@ -2,9 +2,10 @@ zend multibyte (6) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=EUC-JP diff --git a/ext/mbstring/tests/zend_multibyte-07.phpt b/ext/mbstring/tests/zend_multibyte-07.phpt index 9055d23f03..30305f5fdf 100644 --- a/ext/mbstring/tests/zend_multibyte-07.phpt +++ b/ext/mbstring/tests/zend_multibyte-07.phpt @@ -2,9 +2,10 @@ zend multibyte (7) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=ISO-8859-1 diff --git a/ext/mbstring/tests/zend_multibyte-08.phpt b/ext/mbstring/tests/zend_multibyte-08.phpt index f865f6b5b3..ab27461355 100644 --- a/ext/mbstring/tests/zend_multibyte-08.phpt +++ b/ext/mbstring/tests/zend_multibyte-08.phpt @@ -2,9 +2,10 @@ zend multibyte (8) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=ISO-8859-1 diff --git a/ext/mbstring/tests/zend_multibyte-09.phpt b/ext/mbstring/tests/zend_multibyte-09.phpt index a1544f3388..79ee435aa0 100644 --- a/ext/mbstring/tests/zend_multibyte-09.phpt +++ b/ext/mbstring/tests/zend_multibyte-09.phpt @@ -2,9 +2,10 @@ zend multibyte (9) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=cp1251 diff --git a/ext/mbstring/tests/zend_multibyte-10.phpt b/ext/mbstring/tests/zend_multibyte-10.phpt index 6e860d76f6..c3543c937a 100644 --- a/ext/mbstring/tests/zend_multibyte-10.phpt +++ b/ext/mbstring/tests/zend_multibyte-10.phpt @@ -2,9 +2,10 @@ zend multibyte (10) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-11.phpt b/ext/mbstring/tests/zend_multibyte-11.phpt index d525c01e25..84e16ae467 100644 --- a/ext/mbstring/tests/zend_multibyte-11.phpt +++ b/ext/mbstring/tests/zend_multibyte-11.phpt @@ -2,9 +2,10 @@ zend multibyte (11) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-12.phpt b/ext/mbstring/tests/zend_multibyte-12.phpt index 6bc43248e3..e1c8ce52d1 100644 --- a/ext/mbstring/tests/zend_multibyte-12.phpt +++ b/ext/mbstring/tests/zend_multibyte-12.phpt @@ -2,9 +2,10 @@ zend multibyte (12) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --FILE-- <?php diff --git a/ext/mbstring/tests/zend_multibyte-13.phpt b/ext/mbstring/tests/zend_multibyte-13.phpt index f929d9588b..e601a6ceed 100644 --- a/ext/mbstring/tests/zend_multibyte-13.phpt +++ b/ext/mbstring/tests/zend_multibyte-13.phpt @@ -2,9 +2,10 @@ zend multibyte (13) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=UTF-8 diff --git a/ext/mbstring/tests/zend_multibyte-14.phpt b/ext/mbstring/tests/zend_multibyte-14.phpt index e70ad699aa..04bc409fb6 100644 --- a/ext/mbstring/tests/zend_multibyte-14.phpt +++ b/ext/mbstring/tests/zend_multibyte-14.phpt @@ -2,9 +2,10 @@ zend multibyte (14) --SKIPIF-- <?php -ini_set("mbstring.script_encoding", "SJIS"); -ini_set("mbstring.script_encoding", "***") != "SJIS" and +ini_set("mbstring.script_encoding","SJIS"); +if (ini_set("mbstring.script_encoding","SJIS") != "SJIS") { die("skip zend-multibyte is not available"); +} ?> --INI-- mbstring.script_encoding=UTF-8 |
