From bce7094e229d3514d3024bcef01c2385081b69fb Mon Sep 17 00:00:00 2001 From: taca Date: Mon, 12 Sep 2011 16:24:32 +0000 Subject: Add some patches to fix build problem of databases/php-mssql with recent updated databases/freetds. --- lang/php53/patches/patch-php__mssql.c | 27 +++++++++++++++++++++++++++ lang/php53/patches/patch-php__mssql.h | 14 ++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 lang/php53/patches/patch-php__mssql.c create mode 100644 lang/php53/patches/patch-php__mssql.h (limited to 'lang/php53/patches') 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" -- cgit v1.2.3