1
0
mirror of https://github.com/danog/ext-pq.git synced 2024-11-26 11:54:50 +01:00

zts and 5.6 fixes

This commit is contained in:
Michael Wallner 2014-05-23 11:29:30 +02:00
parent 9255d2d54b
commit bf2e263195
5 changed files with 15 additions and 8 deletions

View 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

View File

@ -18,6 +18,13 @@
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);

View 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)

View 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);
}

View 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");