tony2001                Mon Jan 29 10:08:17 2007 UTC

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/imap   config.m4 php_imap.c 
  Log:
  backported fix for ext/imap compilation failure with recent c-client versions
  (fixes #39401)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.1247.2.920.2.186&r2=1.1247.2.920.2.187&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.186 php-src/NEWS:1.1247.2.920.2.187
--- php-src/NEWS:1.1247.2.920.2.186     Mon Jan 22 19:59:21 2007
+++ php-src/NEWS        Mon Jan 29 10:08:16 2007
@@ -7,6 +7,8 @@
   class). (Ilia)
 - Backported a fix in the configure tests to detect the "rounding fuzz".
   (Derick, Joe Orton)
+- Backported fix for ext/imap compilation failure with recent c-client 
+  versions. (Tony)
 
 - Moved extensions to PECL:
   . ext/ovrimos (Derick)
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/config.m4?r1=1.49.2.15&r2=1.49.2.15.2.1&diff_format=u
Index: php-src/ext/imap/config.m4
diff -u php-src/ext/imap/config.m4:1.49.2.15 
php-src/ext/imap/config.m4:1.49.2.15.2.1
--- php-src/ext/imap/config.m4:1.49.2.15        Tue Jan 11 04:56:57 2005
+++ php-src/ext/imap/config.m4  Mon Jan 29 10:08:17 2007
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: config.m4,v 1.49.2.15 2005/01/11 04:56:57 sniper Exp $
+dnl $Id: config.m4,v 1.49.2.15.2.1 2007/01/29 10:08:17 tony2001 Exp $
 dnl
 
 AC_DEFUN([IMAP_INC_CHK],[if test -r "$i$1/c-client.h"; then
@@ -127,6 +127,49 @@
       AC_DEFINE(HAVE_IMAP2004,1,[ ])
     ])
 
+    dnl Check for new version of the utf8_mime2text() function
+    old_CFLAGS=$CFLAGS
+    CFLAGS="-I$IMAP_INC_DIR"
+    AC_CACHE_CHECK(for utf8_mime2text signature, ac_cv_utf8_mime2text,
+      AC_TRY_COMPILE([
+#include <stdio.h>
+#include <c-client.h>
+      ],[
+        SIZEDTEXT *src, *dst;
+        utf8_mime2text(src, dst);
+      ],[
+        ac_cv_utf8_mime2text=old
+      ],[
+        ac_cv_utf8_mime2text=new
+      ])
+    )
+    if test "$ac_cv_utf8_mime2text" = "new"; then
+      AC_DEFINE(HAVE_NEW_MIME2TEXT, 1, [Whether utf8_mime2text() has new 
signature])
+    fi
+    CFLAGS=$old_CPPFLAGS
+
+    old_CFLAGS=$CFLAGS
+    CFLAGS="-I$IMAP_INC_DIR"
+    AC_CACHE_CHECK(for U8T_CANONICAL, ac_cv_u8t_canonical,
+      AC_TRY_COMPILE([
+#include <c-client.h>
+      ],[
+         int i = U8T_CANONICAL;
+      ],[
+         ac_cv_u8t_canonical=yes
+      ],[
+         ac_cv_u8t_canonical=no
+      ])
+    )
+    CFLAGS=$old_CPPFLAGS
+
+    if test "$ac_cv_u8t_canonical" = "no" && test "$ac_cv_utf8_mime2text" = 
"new"; then
+        AC_MSG_ERROR([utf8_mime2text() has new signature, but U8T_CANONICAL is 
missing. This should not happen. Check config.log for additional information.])
+    fi
+    if test "$ac_cv_u8t_canonical" = "yes" && test "$ac_cv_utf8_mime2text" = 
"old"; then
+        AC_MSG_ERROR([utf8_mime2text() has old signature, but U8T_CANONICAL is 
present. This should not happen. Check config.log for additional information.])
+    fi
+
     dnl Check for c-client version 2001
     old_CPPFLAGS=$CPPFLAGS
     CPPFLAGS=-I$IMAP_INC_DIR
http://cvs.php.net/viewvc.cgi/php-src/ext/imap/php_imap.c?r1=1.142.2.44.2.10&r2=1.142.2.44.2.11&diff_format=u
Index: php-src/ext/imap/php_imap.c
diff -u php-src/ext/imap/php_imap.c:1.142.2.44.2.10 
php-src/ext/imap/php_imap.c:1.142.2.44.2.11
--- php-src/ext/imap/php_imap.c:1.142.2.44.2.10 Mon Jan  1 09:46:43 2007
+++ php-src/ext/imap/php_imap.c Mon Jan 29 10:08:17 2007
@@ -26,7 +26,7 @@
    | PHP 4.0 updates:  Zeev Suraski <[EMAIL PROTECTED]>                       |
    +----------------------------------------------------------------------+
  */
-/* $Id: php_imap.c,v 1.142.2.44.2.10 2007/01/01 09:46:43 sebastian Exp $ */
+/* $Id: php_imap.c,v 1.142.2.44.2.11 2007/01/29 10:08:17 tony2001 Exp $ */
 
 #define IMAP41
 
@@ -74,7 +74,11 @@
 void rfc822_date(char *date);
 char *cpystr(const char *str);
 char *cpytxt(SIZEDTEXT *dst, char *text, unsigned long size);
+#ifndef HAVE_NEW_MIME2TEXT
 long utf8_mime2text(SIZEDTEXT *src, SIZEDTEXT *dst);
+#else
+long utf8_mime2text (SIZEDTEXT *src, SIZEDTEXT *dst, long flags);
+#endif
 unsigned long find_rightmost_bit(unsigned long *valptr);
 void fs_give(void **block);
 void *fs_get(size_t size);
@@ -2064,7 +2068,11 @@
        dest.size = 0;
 
        cpytxt(&src, Z_STRVAL_PP(str), Z_STRLEN_PP(str));
+#ifndef HAVE_NEW_MIME2TEXT
        utf8_mime2text(&src, &dest);
+#else
+       utf8_mime2text(&src, &dest, U8T_CANONICAL);
+#endif
        RETURN_STRINGL(dest.data, strlen(dest.data), 1);
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to