zts and 5.6 fixes ida
authorMichael Wallner <mike@php.net>
Fri, 23 May 2014 09:29:30 +0000 (11:29 +0200)
committerMichael Wallner <mike@php.net>
Fri, 23 May 2014 09:29:30 +0000 (11:29 +0200)
src/php_pq_callback.h
src/php_pq_misc.h
src/php_pqconn.c
src/php_pqcur.c
src/php_pqtxn.c

index a5d167a..3b0d48e 100644 (file)
@@ -24,7 +24,7 @@ typedef struct php_pq_callback {
 void php_pq_callback_dtor(php_pq_callback_t *cb);
 void php_pq_callback_addref(php_pq_callback_t *cb);
 zval *php_pq_callback_to_zval(php_pq_callback_t *cb);
-zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb);
+zend_bool php_pq_callback_is_locked(php_pq_callback_t *cb TSRMLS_DC);
 void php_pq_callback_recurse(php_pq_callback_t *old, php_pq_callback_t *new TSRMLS_DC);
 
 #endif
index 0ba99a2..9198929 100644 (file)
 
 typedef int STATUS; /* SUCCESS/FAILURE */
 
+/* TSRM morony */
+#if PHP_VERSION_ID >= 50700
+#      define z_is_true(z) zend_is_true(z TSRMLS_CC)
+#else
+#      define z_is_true zend_is_true
+#endif
+
 /* trim LF from EOL */
 char *rtrim(char *e);
 
index 79fa9a0..a1492f0 100644 (file)
@@ -238,7 +238,7 @@ static void php_pqconn_object_write_unbuffered(zval *object, void *o, zval *valu
 {
        php_pqconn_object_t *obj = o;
 
-       obj->intern->unbuffered = zend_is_true(value);
+       obj->intern->unbuffered = z_is_true(value);
 }
 
 static void php_pqconn_object_read_db(zval *object, void *o, zval *return_value TSRMLS_DC)
index 1cb5d58..00ad2b8 100644 (file)
@@ -82,7 +82,7 @@ static void cur_fetch_or_move(INTERNAL_FUNCTION_PARAMETERS, const char *action,
                                } else if (obj->intern->conn->intern->unbuffered && !PQsetSingleRowMode(obj->intern->conn->intern->conn)) {
                                        throw_exce(EX_RUNTIME TSRMLS_CC, "Failed to enable unbuffered mode (%s)", PHP_PQerrorMessage(obj->intern->conn->intern->conn));
                                } else {
-                                       php_pq_callback_recurse(&obj->intern->conn->intern->onevent, &resolver);
+                                       php_pq_callback_recurse(&obj->intern->conn->intern->onevent, &resolver TSRMLS_CC);
                                        obj->intern->conn->intern->poller = PQconsumeInput;
                                }
                        } else {
@@ -176,9 +176,9 @@ static PHP_METHOD(pqcur, open)
                php_pqcur_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
                if (!obj->intern) {
-                       throw_exce(EX_UNINITIALIZED, "pq\\Cursor not initialized");
+                       throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Cursor not initialized");
                } else if (!obj->intern->open) {
-                       if (SUCCESS == php_pqconn_declare(NULL, obj->intern->conn, obj->intern->decl)) {
+                       if (SUCCESS == php_pqconn_declare(NULL, obj->intern->conn, obj->intern->decl TSRMLS_CC)) {
                                obj->intern->open = 1;
                        }
                }
@@ -200,7 +200,7 @@ static PHP_METHOD(pqcur, close)
                php_pqcur_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
 
                if (!obj->intern) {
-                       throw_exce(EX_UNINITIALIZED, "pq\\Cursor not initialized");
+                       throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Cursor not initialized");
                } else {
                        cur_close(obj TSRMLS_CC);
                }
index 7d4b8b7..41b4950 100644 (file)
@@ -175,7 +175,7 @@ static void php_pqtxn_object_write_readonly(zval *object, void *o, zval *value T
        php_pqtxn_object_t *obj = o;
        PGresult *res;
 
-       if ((obj->intern->readonly = zend_is_true(value))) {
+       if ((obj->intern->readonly = z_is_true(value))) {
                res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ ONLY");
        } else {
                res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION READ WRITE");
@@ -192,7 +192,7 @@ static void php_pqtxn_object_write_deferrable(zval *object, void *o, zval *value
        php_pqtxn_object_t *obj = o;
        PGresult *res;
 
-       if ((obj->intern->deferrable = zend_is_true(value))) {
+       if ((obj->intern->deferrable = z_is_true(value))) {
                res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION DEFERRABLE");
        } else {
                res = PQexec(obj->intern->conn->intern->conn, "SET TRANSACTION NOT DEFERRABLE");