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 a5d167a1d6fa5cc965fab5923865661832866980..3b0d48ed74fb5408bd988b24787d314b4fa316e2 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 0ba99a2b8f88c6e362313c1322098d599a9cda0d..919892952e0576d8e7314f1ddc95ad2af13da1e3 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 79fa9a0422d58ca8bd74779b5b32a401d7bfada8..a1492f0b8af5a9adb64ad5e37d56f6f93ad02cb9 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 1cb5d584fc0dbf68a36d9a6857f615825c3474cd..00ad2b83d63c09c9cb761543b65ad74744111b23 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 7d4b8b73cd9ac885780e67a391f2888765e2d8c8..41b49508bf0581a940975e348e54fd6d599dd397 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");