summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2007-02-12 09:36:23 +0000
committerAntony Dovgal <tony2001@php.net>2007-02-12 09:36:23 +0000
commit8e49f0c54cee1a474426aa97edd8e736ae3d6304 (patch)
tree639501514626c460a34055294425f946b41d9006
parent23d484ff2be38b35a67001b1a67a1c998ce3b6fa (diff)
downloadphp-git-8e49f0c54cee1a474426aa97edd8e736ae3d6304.tar.gz
MFH
-rw-r--r--ext/oci8/config.m42
-rw-r--r--ext/oci8/oci8.c2
-rw-r--r--ext/oci8/php_oci8_int.h70
3 files changed, 41 insertions, 33 deletions
diff --git a/ext/oci8/config.m4 b/ext/oci8/config.m4
index 8e04ee7715..644c34e88f 100644
--- a/ext/oci8/config.m4
+++ b/ext/oci8/config.m4
@@ -99,7 +99,7 @@ PHP_ARG_WITH(oci8, for Oracle (OCI8) support,
[ --with-oci8[=DIR] Include Oracle (OCI8) support.
The default DIR is ORACLE_HOME.
Use --with-oci8=instantclient,/path/to/oic/lib
- to use Oracle Instant Client installation])
+ to use an Oracle Instant Client installation])
AC_MSG_CHECKING([checking PHP version])
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index ac221129a2..60c4436f97 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1054,7 +1054,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
size_t rsize = 0;
sword result;
- PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize))
+ PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize));
if (result != OCI_SUCCESS) {
charsetid_nls_lang = 0;
}
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 5615d8a3ed..719496a838 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -222,41 +222,47 @@ typedef struct { /* php_oci_out_column {{{ */
/* {{{ macros */
#define PHP_OCI_CALL(func, params) \
- OCI_G(in_call) = 1; \
- func params; \
- OCI_G(in_call) = 0; \
- if (OCI_G(debug_mode)) { \
- php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
- }
+ do { \
+ OCI_G(in_call) = 1; \
+ func params; \
+ OCI_G(in_call) = 0; \
+ if (OCI_G(debug_mode)) { \
+ php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
+ } \
+ } while (0)
#define PHP_OCI_CALL_RETURN(__retval, func, params) \
- OCI_G(in_call) = 1; \
- __retval = func params; \
- OCI_G(in_call) = 0; \
- if (OCI_G(debug_mode)) { \
- php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
- }
+ do { \
+ OCI_G(in_call) = 1; \
+ __retval = func params; \
+ OCI_G(in_call) = 0; \
+ if (OCI_G(debug_mode)) { \
+ php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
+ } \
+ } while (0)
#define PHP_OCI_HANDLE_ERROR(connection, errcode) \
-{ \
- switch (errcode) { \
- case 1013: \
- zend_bailout(); \
+ do { \
+ switch (errcode) { \
+ case 1013: \
+ zend_bailout(); \
break; \
- case 22: \
- case 1012: \
- case 3113: \
- case 604: \
- case 1041: \
- case 3114: \
- connection->is_open = 0; \
+ case 22: \
+ case 1012: \
+ case 3113: \
+ case 604: \
+ case 1041: \
+ case 3114: \
+ connection->is_open = 0; \
break; \
- } \
-} \
+ } \
+ } while (0)
#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
- resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
- zend_list_addref(resource->connection->rsrc_id);
+ do { \
+ resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
+ zend_list_addref(resource->connection->rsrc_id); \
+ } 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);
@@ -271,10 +277,12 @@ typedef struct { /* php_oci_out_column {{{ */
ZEND_FETCH_RESOURCE(collection, php_oci_collection *, &zval, -1, "oci8 collection", le_collection)
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
- var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
- if (!var) { \
- return 1; \
- }
+ do { \
+ var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
+ if (!var) { \
+ return 1; \
+ } \
+ } while (0)
#define PHP_OCI_ZVAL_TO_CONNECTION_EX(zval, connection) \
PHP_OCI_FETCH_RESOURCE_EX(zval, connection, php_oci_connection *, "oci8 connection", le_connection)