diff options
author | Jakub Zelenka <bukka@php.net> | 2015-02-08 14:08:31 +0000 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2015-02-08 14:08:31 +0000 |
commit | f2825042b4dd9aa941a080c027f15f41c1b9e4bc (patch) | |
tree | 2e7d97c1dfd4aeabb506ffdd206a612b82adea8d /ext/oci8/php_oci8_int.h | |
parent | 0a81f9a0bd36deac8707949acbcf92f612b60e8e (diff) | |
parent | ce9f52adcdfb19f70dc4274f3587e58ac07995bd (diff) | |
download | php-git-f2825042b4dd9aa941a080c027f15f41c1b9e4bc.tar.gz |
Merge branch 'master' into jsond
Conflicts:
ext/json/json.c
Diffstat (limited to 'ext/oci8/php_oci8_int.h')
-rw-r--r-- | ext/oci8/php_oci8_int.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h index 7103e5a9dd..c4b1f1bd14 100644 --- a/ext/oci8/php_oci8_int.h +++ b/ext/oci8/php_oci8_int.h @@ -357,24 +357,32 @@ typedef struct { #define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \ do { \ - resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \ + resource->id = zend_register_resource(resource, le_resource); \ } while (0) #define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \ - ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, zval, -1, "oci8 connection", le_connection, le_pconnection) + if ((connection = (php_oci_connection *)zend_fetch_resource2(Z_RES_P(zval), "oci8 connection", le_connection, le_pconnection)) == NULL) { \ + RETURN_FALSE; \ + } #define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \ - ZEND_FETCH_RESOURCE(statement, php_oci_statement *, zval, -1, "oci8 statement", le_statement) + if ((statement = (php_oci_statement *)zend_fetch_resource(Z_RES_P(zval), "oci8 statement", le_statement)) == NULL) { \ + RETURN_FALSE; \ + } #define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \ - ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, zval, -1, "oci8 descriptor", le_descriptor) + if ((descriptor = (php_oci_descriptor *)zend_fetch_resource(Z_RES_P(zval), "oci8 descriptor", le_descriptor)) == NULL) { \ + RETURN_FALSE; \ + } #define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \ - ZEND_FETCH_RESOURCE(collection, php_oci_collection *, zval, -1, "oci8 collection", le_collection) + if ((collection = (php_oci_collection *)zend_fetch_resource(Z_RES_P(zval), "oci8 collection", le_collection)) == NULL) { \ + RETURN_FALSE; \ + } #define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \ do { \ - var = (type) zend_fetch_resource(zval, -1, name, NULL, 1, resource_type); \ + var = (type) zend_fetch_resource(Z_RES_P(zval), name, resource_type); \ if (!var) { \ return 1; \ } \ |