summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJani Taskinen <jani@php.net>2009-05-05 01:22:31 +0000
committerJani Taskinen <jani@php.net>2009-05-05 01:22:31 +0000
commit9d4b8c7cc3e2930c92389eb98ee040915c862891 (patch)
tree6ebdbdab29990236b3570ba75fd346a28ff66167
parent0ad777e011e54a49741bd6c16ae4c27425bc09ef (diff)
downloadphp-git-9d4b8c7cc3e2930c92389eb98ee040915c862891.tar.gz
- Fix build (modified utf7 stuff is rather new..)
-rw-r--r--ext/imap/config.m418
-rw-r--r--ext/imap/php_imap.c8
-rw-r--r--ext/imap/php_imap.h2
3 files changed, 20 insertions, 8 deletions
diff --git a/ext/imap/config.m4 b/ext/imap/config.m4
index 07026d704d..4ec798cee7 100644
--- a/ext/imap/config.m4
+++ b/ext/imap/config.m4
@@ -228,13 +228,10 @@ if test "$PHP_IMAP" != "no"; then
AC_DEFINE(HAVE_IMAP_AUTH_GSS, 1, [ ])
], [], $TST_LIBS)
- AC_MSG_CHECKING(whether build with IMAP works)
- PHP_IMAP_TEST_BUILD(mail_newbody, [
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_ERROR([build test failed. Please check the config.log for details.])
- ], $TST_LIBS)
+ dnl Check if utf8_to_mutf7 exists
+ PHP_IMAP_TEST_BUILD(utf8_to_mutf7, [
+ AC_DEFINE(HAVE_IMAP_MUTF7, 1, [ ])
+ ], [], $TST_LIBS)
AC_MSG_CHECKING(whether rfc822_output_address_list function present)
PHP_TEST_BUILD(foobar, [
@@ -271,4 +268,11 @@ if test "$PHP_IMAP" != "no"; then
char foobar () {f = rfc822_output_address_list;}
])
+ AC_MSG_CHECKING(whether build with IMAP works)
+ PHP_IMAP_TEST_BUILD(mail_newbody, [
+ AC_MSG_RESULT(yes)
+ ], [
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR([build test failed. Please check the config.log for details.])
+ ], $TST_LIBS)
fi
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c
index feadb06774..e3cc92aee2 100644
--- a/ext/imap/php_imap.c
+++ b/ext/imap/php_imap.c
@@ -351,6 +351,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf7_encode, 0, 0, 1)
ZEND_ARG_INFO(0, buf)
ZEND_END_ARG_INFO()
+#ifdef HAVE_IMAP_MUTF7
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_utf8_to_mutf7, 0, 0, 1)
ZEND_ARG_INFO(0, in)
ZEND_END_ARG_INFO()
@@ -358,6 +359,7 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_mutf7_to_utf8, 0, 0, 1)
ZEND_ARG_INFO(0, in)
ZEND_END_ARG_INFO()
+#endif
ZEND_BEGIN_ARG_INFO_EX(arginfo_imap_setflag_full, 0, 0, 3)
ZEND_ARG_INFO(0, stream_id)
@@ -517,8 +519,10 @@ const zend_function_entry imap_functions[] = {
PHP_FE(imap_search, arginfo_imap_search)
PHP_FE(imap_utf7_decode, arginfo_imap_utf7_decode)
PHP_FE(imap_utf7_encode, arginfo_imap_utf7_encode)
+#ifdef HAVE_IMAP_MUTF7
PHP_FE(imap_utf8_to_mutf7, arginfo_imap_utf8_to_mutf7)
PHP_FE(imap_mutf7_to_utf8, arginfo_imap_mutf7_to_utf8)
+#endif
PHP_FE(imap_mime_header_decode, arginfo_imap_mime_header_decode)
PHP_FE(imap_thread, arginfo_imap_thread)
PHP_FE(imap_timeout, arginfo_imap_timeout)
@@ -2338,7 +2342,7 @@ PHP_FUNCTION(imap_savebody)
IMAPG(gets_stream) = writer;
mail_parameters(NIL, SET_GETS, (void *) php_mail_gets);
mail_fetchbody_full(imap_ptr->imap_stream, msgno, section, NULL, flags);
- mail_parameters(NIL, SET_GETS, (void *) NIL);
+ mail_parameters(NIL, SET_GETS, (void *) NULL);
IMAPG(gets_stream) = NULL;
if (close_stream) {
@@ -2891,6 +2895,7 @@ PHP_FUNCTION(imap_utf7_encode)
#undef B64
#undef UNB64
+#ifdef HAVE_IMAP_MUTF7
static void php_imap_mutf7(INTERNAL_FUNCTION_PARAMETERS, int mode)
{
char *in;
@@ -2937,6 +2942,7 @@ PHP_FUNCTION(imap_utf8_to_mutf7)
{
php_imap_mutf7(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0);
}
+#endif
/* {{{ proto string imap_mutf7_to_utf8(string in)
Decode a modified UTF-7 string to UTF-8 */
diff --git a/ext/imap/php_imap.h b/ext/imap/php_imap.h
index 8903cd4c6f..bd4e08167c 100644
--- a/ext/imap/php_imap.h
+++ b/ext/imap/php_imap.h
@@ -165,8 +165,10 @@ PHP_FUNCTION(imap_search);
PHP_FUNCTION(imap_utf8);
PHP_FUNCTION(imap_utf7_decode);
PHP_FUNCTION(imap_utf7_encode);
+#ifdef HAVE_IMAP_MUTF7
PHP_FUNCTION(imap_utf8_to_mutf7);
PHP_FUNCTION(imap_mutf7_to_utf8);
+#endif
PHP_FUNCTION(imap_mime_header_decode);
PHP_FUNCTION(imap_thread);
PHP_FUNCTION(imap_timeout);