summaryrefslogtreecommitdiff
path: root/ext/interbase/interbase.c
diff options
context:
space:
mode:
authorArd Biesheuvel <abies@php.net>2004-04-03 11:00:14 +0000
committerArd Biesheuvel <abies@php.net>2004-04-03 11:00:14 +0000
commitcd7e8bdf8c4b3b91f0b8b6532efa780d3d96dca1 (patch)
tree9fe3ee308d8e3a81f41a06df3b9809662c220f6d /ext/interbase/interbase.c
parent53671580462be039edf4a68729b1babb43c25b21 (diff)
downloadphp-git-cd7e8bdf8c4b3b91f0b8b6532efa780d3d96dca1.tar.gz
Change definition of ISC_LONG_[MIN|MAX] to please MSVC.
Diffstat (limited to 'ext/interbase/interbase.c')
-rw-r--r--ext/interbase/interbase.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c
index 1bc1a293b8..305e94c0cb 100644
--- a/ext/interbase/interbase.c
+++ b/ext/interbase/interbase.c
@@ -50,8 +50,8 @@
#define IBDEBUG(a)
#endif
-#define ISC_LONG_MIN (1 << (8*sizeof(ISC_LONG)-1))
-#define ISC_LONG_MAX ~ISC_LONG_MIN
+#define ISC_LONG_MIN INT_MIN
+#define ISC_LONG_MAX INT_MAX
#define QUERY_RESULT 1
#define EXECUTE_RESULT 2
@@ -872,7 +872,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
{
char hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL };
int i, len[] = { 0, 0, 0, 0, 0 };
- long largs[] = { 0, SQL_DIALECT_CURRENT };
+ long largs[] = { 0, 0 };
PHP_MD5_CTX hash_context;
list_entry new_index_ptr, *le;
isc_db_handle db_handle = NULL;
@@ -2373,7 +2373,7 @@ PHP_FUNCTION(ibase_query)
ib_link->dialect = SQL_DIALECT_CURRENT;
ib_link->tr_list = NULL;
ib_link->event_head = NULL;
-
+
ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link);
zend_list_addref(Z_LVAL_P(return_value));
IBG(default_link) = Z_LVAL_P(return_value);
@@ -2518,11 +2518,9 @@ PHP_FUNCTION(ibase_num_rows)
* - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a
* higher number than the number of records fetched so far (no pre-fetch);
* - the result of num_rows() for other statements is merely a lower bound
- * on the number of records => calling ibase_num_rows() again after a couple
- * of fetches will most likely return a new (higher) figure for large result
- * sets.
- *
- * 12-aug-2003 Ard Biesheuvel
+ * on the number of records => calling ibase_num_rows() again after a couple
+ * of fetches will most likely return a new (higher) figure for large result
+ * sets.
*/
zval **result_arg;
@@ -3466,7 +3464,7 @@ PHP_FUNCTION(ibase_gen_id)
}
/* don't return the generator value as a string unless it doesn't fit in a long */
-#ifdef SQL_INT64
+#if SQL_INT64 && SIZEOF_LONG < 8
if (result < LONG_MIN || result > LONG_MAX) {
char res[24];
@@ -3478,7 +3476,7 @@ PHP_FUNCTION(ibase_gen_id)
}
/* }}} */
-
+
#endif /* HAVE_IBASE */
/*