Sophie

Sophie

distrib > Mandriva > 2010.2 > i586 > media > contrib-release-src > by-pkgid > 4831b24205b3856068431ef748f84bf9 > files > 1

php-dbx-1.1.0-30mdv2010.1.src.rpm

diff -Naurp dbx-1.1.0/dbx.c dbx-1.1.0.oden/dbx.c
--- dbx-1.1.0/dbx.c	2005-08-07 18:15:24.000000000 +0200
+++ dbx-1.1.0.oden/dbx.c	2009-10-06 11:57:23.000000000 +0200
@@ -52,6 +52,16 @@
 #include "dbx_sybasect.h"
 #include "dbx_sqlite.h"
 
+#ifndef Z_ADDREF_P
+# define Z_ADDREF_P(pz) (pz)->refcount++;
+# define Z_ADDREF_PP(ppz) Z_ADDREF_P(*(ppz))
+#endif
+
+#ifndef Z_SET_ISREF_P
+# define Z_SET_ISREF_P(pz) (pz)->is_ref = 1;
+# define Z_SET_ISREF_PP(ppz) Z_SET_ISREF_P(*(ppz))
+#endif
+
 /* support routines */
 int module_exists(char *module_name)
 {
@@ -532,8 +542,8 @@ ZEND_FUNCTION(dbx_query)
 					for (col_index=0; col_index<Z_LVAL_P(rv_column_count); ++col_index) {
 						zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
 						zend_hash_index_find(Z_ARRVAL_PP(row_ptr), col_index, (void **) &actual_ptr);
-						(*actual_ptr)->refcount+=1;
-						(*actual_ptr)->is_ref=1;
+						Z_ADDREF_PP(actual_ptr);
+						Z_SET_ISREF_PP(actual_ptr);
 						zend_hash_update(Z_ARRVAL_PP(row_ptr), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
 					}
 				}
@@ -606,8 +616,8 @@ ZEND_FUNCTION(dbx_fetch_row)
 			for (col_index=0; col_index<col_count; ++col_index) {
 				zend_hash_index_find(Z_ARRVAL_PP(inforow_ptr), col_index, (void **) &columnname_ptr);
 				zend_hash_index_find(Z_ARRVAL_P(return_value), col_index, (void **) &actual_ptr);
-				(*actual_ptr)->refcount+=1;
-				(*actual_ptr)->is_ref=1;
+				Z_ADDREF_PP(actual_ptr);
+				Z_SET_ISREF_PP(actual_ptr);
 				zend_hash_update(Z_ARRVAL_P(return_value), Z_STRVAL_PP(columnname_ptr), Z_STRLEN_PP(columnname_ptr) + 1, actual_ptr, sizeof(zval *), NULL);
 			}
 		}
diff -Naurp dbx-1.1.0/dbx.h dbx-1.1.0.oden/dbx.h
--- dbx-1.1.0/dbx.h	2005-08-07 18:15:24.000000000 +0200
+++ dbx-1.1.0.oden/dbx.h	2009-10-06 11:57:30.000000000 +0200
@@ -29,6 +29,10 @@
 #include "zend_modules.h"
 #endif
 
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include "php.h"
 #include "ext/standard/php_string.h"