Skip to content

Commit 0121db1

Browse files
committed
Code cleanup
Remove unneeded `#if FB_API_VER >= 25`, `#if FB_API_VER >= 30`, `#ifdef SQL_BOOLEAN`
1 parent 327588a commit 0121db1

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -602,14 +602,12 @@ void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state,
602602
einfo->errmsg_length = read_len;
603603
einfo->errmsg = pestrndup(buf, read_len, dbh->is_persistent);
604604

605-
#if FB_API_VER >= 25
606605
char sqlstate[sizeof(pdo_error_type)];
607606
fb_sqlstate(sqlstate, H->isc_status);
608607
if (sqlstate != NULL && strlen(sqlstate) < sizeof(pdo_error_type)) {
609608
strcpy(*error_code, sqlstate);
610609
goto end;
611610
}
612-
#endif
613611
} else if (msg && msg_len) {
614612
einfo->errmsg_length = msg_len;
615613
einfo->errmsg = pestrndup(msg, einfo->errmsg_length, dbh->is_persistent);
@@ -1333,7 +1331,6 @@ static int pdo_firebird_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
13331331
}
13341332
/* }}} */
13351333

1336-
#if FB_API_VER >= 30
13371334
/* called by PDO to check liveness */
13381335
static zend_result pdo_firebird_check_liveness(pdo_dbh_t *dbh) /* {{{ */
13391336
{
@@ -1343,7 +1340,6 @@ static zend_result pdo_firebird_check_liveness(pdo_dbh_t *dbh) /* {{{ */
13431340
return fb_ping(H->isc_status, &H->db) ? FAILURE : SUCCESS;
13441341
}
13451342
/* }}} */
1346-
#endif
13471343

13481344
/* called by PDO to retrieve driver-specific information about an error that has occurred */
13491345
static void pdo_firebird_fetch_error_func(pdo_dbh_t *dbh, pdo_stmt_t *stmt, zval *info) /* {{{ */
@@ -1383,11 +1379,7 @@ static const struct pdo_dbh_methods firebird_methods = { /* {{{ */
13831379
NULL, /* last_id not supported */
13841380
pdo_firebird_fetch_error_func,
13851381
pdo_firebird_get_attribute,
1386-
#if FB_API_VER >= 30
13871382
pdo_firebird_check_liveness,
1388-
#else
1389-
NULL,
1390-
#endif
13911383
NULL, /* get driver methods */
13921384
NULL, /* request shutdown */
13931385
pdo_firebird_in_manually_transaction,

ext/pdo_firebird/firebird_statement.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,9 @@ static int pdo_firebird_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno,
349349
#endif
350350
param_type = PDO_PARAM_INT;
351351
break;
352-
#ifdef SQL_BOOLEAN
353352
case SQL_BOOLEAN:
354353
param_type = PDO_PARAM_BOOL;
355354
break;
356-
#endif
357355
default:
358356
param_type = PDO_PARAM_STR;
359357
break;
@@ -542,11 +540,9 @@ static int pdo_firebird_stmt_get_col(
542540
/* TODO: Why is this not returned as the native type? */
543541
ZVAL_STR(result, zend_strpprintf_unchecked(0, "%.16H", php_get_double_from_sqldata(var->sqldata)));
544542
break;
545-
#ifdef SQL_BOOLEAN
546543
case SQL_BOOLEAN:
547544
ZVAL_BOOL(result, *(FB_BOOLEAN*)var->sqldata);
548545
break;
549-
#endif
550546
case SQL_TYPE_DATE:
551547
isc_decode_sql_date((ISC_DATE*)var->sqldata, &t);
552548
fmt = S->H->date_format ? S->H->date_format : PDO_FB_DEF_DATE_FMT;
@@ -744,7 +740,6 @@ static int pdo_firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param
744740
}
745741
}
746742

747-
#ifdef SQL_BOOLEAN
748743
/* keep native BOOLEAN type */
749744
if ((var->sqltype & ~1) == SQL_BOOLEAN) {
750745
switch (Z_TYPE_P(parameter)) {
@@ -797,8 +792,6 @@ static int pdo_firebird_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param
797792
}
798793
break;
799794
}
800-
#endif
801-
802795

803796
/* check if a NULL should be inserted */
804797
switch (Z_TYPE_P(parameter)) {

0 commit comments

Comments
 (0)