Skip to content

Commit cd7e8bd

Browse files
author
Ard Biesheuvel
committed
Change definition of ISC_LONG_[MIN|MAX] to please MSVC.
1 parent 5367158 commit cd7e8bd

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

ext/interbase/interbase.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
#define IBDEBUG(a)
5151
#endif
5252

53-
#define ISC_LONG_MIN (1 << (8*sizeof(ISC_LONG)-1))
54-
#define ISC_LONG_MAX ~ISC_LONG_MIN
53+
#define ISC_LONG_MIN INT_MIN
54+
#define ISC_LONG_MAX INT_MAX
5555

5656
#define QUERY_RESULT 1
5757
#define EXECUTE_RESULT 2
@@ -872,7 +872,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /*
872872
{
873873
char hash[16], *args[] = { NULL, NULL, NULL, NULL, NULL };
874874
int i, len[] = { 0, 0, 0, 0, 0 };
875-
long largs[] = { 0, SQL_DIALECT_CURRENT };
875+
long largs[] = { 0, 0 };
876876
PHP_MD5_CTX hash_context;
877877
list_entry new_index_ptr, *le;
878878
isc_db_handle db_handle = NULL;
@@ -2373,7 +2373,7 @@ PHP_FUNCTION(ibase_query)
23732373
ib_link->dialect = SQL_DIALECT_CURRENT;
23742374
ib_link->tr_list = NULL;
23752375
ib_link->event_head = NULL;
2376-
2376+
23772377
ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link);
23782378
zend_list_addref(Z_LVAL_P(return_value));
23792379
IBG(default_link) = Z_LVAL_P(return_value);
@@ -2518,11 +2518,9 @@ PHP_FUNCTION(ibase_num_rows)
25182518
* - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a
25192519
* higher number than the number of records fetched so far (no pre-fetch);
25202520
* - the result of num_rows() for other statements is merely a lower bound
2521-
* on the number of records => calling ibase_num_rows() again after a couple
2522-
* of fetches will most likely return a new (higher) figure for large result
2523-
* sets.
2524-
*
2525-
* 12-aug-2003 Ard Biesheuvel
2521+
* on the number of records => calling ibase_num_rows() again after a couple
2522+
* of fetches will most likely return a new (higher) figure for large result
2523+
* sets.
25262524
*/
25272525

25282526
zval **result_arg;
@@ -3466,7 +3464,7 @@ PHP_FUNCTION(ibase_gen_id)
34663464
}
34673465

34683466
/* don't return the generator value as a string unless it doesn't fit in a long */
3469-
#ifdef SQL_INT64
3467+
#if SQL_INT64 && SIZEOF_LONG < 8
34703468
if (result < LONG_MIN || result > LONG_MAX) {
34713469
char res[24];
34723470

@@ -3478,7 +3476,7 @@ PHP_FUNCTION(ibase_gen_id)
34783476
}
34793477

34803478
/* }}} */
3481-
3479+
34823480
#endif /* HAVE_IBASE */
34833481

34843482
/*

0 commit comments

Comments
 (0)