cvs: pecl /xdiff config.m4 package.xml xdiff.c
| From: | Marcin Gibula | Date: | Tue, 09 Nov 2004 12:41:22 +0000 |
| Subject: | cvs: pecl /xdiff config.m4 package.xml xdiff.c | ||
| Groups: | php.pecl.cvs | ||
| Request: | Send a blank email to pecl-cvs+get-1998@lists.php.net to get a copy of this message | ||
mg Tue Nov 9 07:41:22 2004 EDT
Modified files:
/pecl/xdiff xdiff.c package.xml config.m4
Log:
Fix libxdiff 0.9 crash.
http://cvs.php.net/diff.php/pecl/xdiff/xdiff.c?r1=1.8&r2=1.9&ty=u
Index: pecl/xdiff/xdiff.c
diff -u pecl/xdiff/xdiff.c:1.8 pecl/xdiff/xdiff.c:1.9
--- pecl/xdiff/xdiff.c:1.8 Fri Aug 13 10:41:00 2004
+++ pecl/xdiff/xdiff.c Tue Nov 9 07:41:21 2004
@@ -15,7 +15,7 @@
| Author: Marcin Gibula <mg@iceni.pl> |
+----------------------------------------------------------------------+
- $Id: xdiff.c,v 1.8 2004/08/13 14:41:00 mg Exp $
+ $Id: xdiff.c,v 1.9 2004/11/09 12:41:21 mg Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -53,6 +53,27 @@
static int make_merge3_str(char *content1, int size1, char *content2, int size2, char *content3,
int size3, xdemitcb_t *output, xdemitcb_t *error);
#ifdef HAVE_XDL_SET_ALLOCATOR
+
+#ifdef HAVE_XDL_ALLOCATOR_PRIV
+/* These are needed to avoid compilation error */
+static void *xdiff_malloc(void *foo, unsigned int size)
+{
+ return emalloc(size);
+}
+
+static void xdiff_free(void *foo, void *ptr)
+{
+ efree(ptr);
+}
+
+static void *xdiff_realloc(void *foo, void *ptr, unsigned int nsize)
+{
+ return erealloc(ptr, nsize);
+}
+
+static memallocator_t allocator = { NULL, xdiff_malloc, xdiff_free, xdiff_realloc };
+
+#else
/* These are needed to avoid compilation error */
static void *xdiff_malloc(unsigned int size)
{
@@ -70,7 +91,8 @@
}
static memallocator_t allocator = { xdiff_malloc, xdiff_free, xdiff_realloc };
-#endif
+#endif /* HAVE_XDL_ALLOCATOR_PRIV */
+#endif /* HAVE_XDL_SET_ALLOCATOR */
/* {{{ xdiff_functions[]
*
@@ -105,7 +127,7 @@
NULL,
PHP_MINFO(xdiff),
#if ZEND_MODULE_API_NO >= 20010901
- "1.1", /* Replace with version number for your extension */
+ "1.2", /* Replace with version number for your extension */
#endif
STANDARD_MODULE_PROPERTIES
};
http://cvs.php.net/diff.php/pecl/xdiff/package.xml?r1=1.6&r2=1.7&ty=u
Index: pecl/xdiff/package.xml
diff -u pecl/xdiff/package.xml:1.6 pecl/xdiff/package.xml:1.7
--- pecl/xdiff/package.xml:1.6 Sun Mar 21 10:13:21 2004
+++ pecl/xdiff/package.xml Tue Nov 9 07:41:21 2004
@@ -17,11 +17,11 @@
</maintainers>
<release>
- <version>1.1</version>
- <date>2004-03-21</date>
+ <version>1.2</version>
+ <date>2004-11-09</date>
<state>stable</state>
<notes>
- Fix FreeBSD build.
+ Fix libxdiff 0.9 crash. Force last parameters of xdiff_string_patch and xdiff_string_merge3 to
be passed by reference.
</notes>
<configureoptions>
<configureoption name="with-xdiff" default="autodetect"
prompt="libxdiff library installation dir?"/>
http://cvs.php.net/diff.php/pecl/xdiff/config.m4?r1=1.3&r2=1.4&ty=u
Index: pecl/xdiff/config.m4
diff -u pecl/xdiff/config.m4:1.3 pecl/xdiff/config.m4:1.4
--- pecl/xdiff/config.m4:1.3 Tue Mar 16 17:13:16 2004
+++ pecl/xdiff/config.m4 Tue Nov 9 07:41:21 2004
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.3 2004/03/16 22:13:16 jon Exp $
+dnl $Id: config.m4,v 1.4 2004/11/09 12:41:21 mg Exp $
dnl config.m4 for extension xdiff
PHP_ARG_WITH(xdiff, for xdiff support,
@@ -57,5 +57,21 @@
-L$XDIFF_DIR/lib
])
+ dnl
+ dnl Check for xdiff 0.9 or greater availability
+ dnl
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS=-I$XDIFF_DIR
+ AC_TRY_COMPILE([
+#include <xdiff.h>
+#include <stdlib.h>
+ ], [
+memallocator_t a;
+a.priv = NULL;
+ ], [
+ AC_DEFINE(HAVE_XDL_ALLOCATOR_PRIV, 1, [ ])
+ ])
+ CPPFLAGS=$old_CPPFLAGS
+
PHP_NEW_EXTENSION(xdiff, xdiff.c, $ext_shared)
fi