summaryrefslogtreecommitdiff
path: root/lang/php53/patches
diff options
context:
space:
mode:
authortaca <taca>2011-09-12 16:24:32 +0000
committertaca <taca>2011-09-12 16:24:32 +0000
commitbce7094e229d3514d3024bcef01c2385081b69fb (patch)
tree6f2e7a6d57fe5522a4feda2c62708a198f9b2d30 /lang/php53/patches
parente4addfa09a667c49f2fa7db84dbf9968e4e77860 (diff)
downloadpkgsrc-bce7094e229d3514d3024bcef01c2385081b69fb.tar.gz
Add some patches to fix build problem of databases/php-mssql with recent
updated databases/freetds.
Diffstat (limited to 'lang/php53/patches')
-rw-r--r--lang/php53/patches/patch-php__mssql.c27
-rw-r--r--lang/php53/patches/patch-php__mssql.h14
2 files changed, 41 insertions, 0 deletions
diff --git a/lang/php53/patches/patch-php__mssql.c b/lang/php53/patches/patch-php__mssql.c
new file mode 100644
index 00000000000..044bb8f8f68
--- /dev/null
+++ b/lang/php53/patches/patch-php__mssql.c
@@ -0,0 +1,27 @@
+$NetBSD: patch-php__mssql.c,v 1.1 2011/09/12 16:24:32 taca Exp $
+
+Fix with newer freetds:
+
+* cast pointer => long => int, hoping values are ranges in int.
+* Don't pass unsigned char ** to spprintf().
+
+--- ext/mssql/php_mssql.c.orig 2011-07-28 11:01:04.000000000 +0000
++++ ext/mssql/php_mssql.c
+@@ -764,7 +764,7 @@ static void php_mssql_do_connect(INTERNA
+ dbfreelogin(mssql.login);
+ RETURN_FALSE;
+ }
+- link = (int) index_ptr->ptr;
++ link = (int)(long) index_ptr->ptr;
+ ptr = zend_list_find(link,&type); /* check if the link is still there */
+ if (ptr && (type==le_link || type==le_plink)) {
+ zend_list_addref(link);
+@@ -1117,7 +1117,7 @@ static void php_mssql_get_column_content
+ }
+
+ res_length = 19;
+- spprintf(&res_buf, 0, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
++ spprintf((char **)&res_buf, 0, "%d-%02d-%02d %02d:%02d:%02d" , dateinfo.year, dateinfo.month, dateinfo.day, dateinfo.hour, dateinfo.minute, dateinfo.second);
+ }
+
+ ZVAL_STRINGL(result, res_buf, res_length, 0);
diff --git a/lang/php53/patches/patch-php__mssql.h b/lang/php53/patches/patch-php__mssql.h
new file mode 100644
index 00000000000..53acf077576
--- /dev/null
+++ b/lang/php53/patches/patch-php__mssql.h
@@ -0,0 +1,14 @@
+$NetBSD: patch-php__mssql.h,v 1.1 2011/09/12 16:24:32 taca Exp $
+
+* Use definition in freetds.
+
+--- ext/mssql/php_mssql.h.orig 2011-01-01 02:19:59.000000000 +0000
++++ ext/mssql/php_mssql.h
+@@ -65,7 +65,6 @@ typedef short TDS_SHORT;
+ #define dbfreelogin dbloginfree
+ #endif
+ #define dbrpcexec dbrpcsend
+-typedef unsigned char *LPBYTE;
+ typedef float DBFLT4;
+ #else
+ #define MSSQL_VERSION "7.0"