Skip to content

Commit d19fdaa

Browse files
authored
Drop legacy fallback for isc_get_client_version() (GH-16343)
The respective code had been introduced 20 years ago, and we can assume that the function is available at least of Firebird 3.0, what we require anyway.
1 parent db991bc commit d19fdaa

File tree

2 files changed

+3
-27
lines changed

2 files changed

+3
-27
lines changed

ext/pdo_firebird/firebird_driver.c

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,27 +1219,9 @@ static int pdo_firebird_get_attribute(pdo_dbh_t *dbh, zend_long attr, zval *val)
12191219
ZVAL_BOOL(val, !isc_version(&H->db, php_firebird_info_cb, NULL));
12201220
return 1;
12211221

1222-
case PDO_ATTR_CLIENT_VERSION: {
1223-
#if defined(__GNUC__) || defined(PHP_WIN32)
1224-
info_func_t info_func = NULL;
1225-
#ifdef __GNUC__
1226-
info_func = (info_func_t)dlsym(RTLD_DEFAULT, "isc_get_client_version");
1227-
#else
1228-
HMODULE l = GetModuleHandle("fbclient");
1229-
1230-
if (!l) {
1231-
break;
1232-
}
1233-
info_func = (info_func_t)GetProcAddress(l, "isc_get_client_version");
1234-
#endif
1235-
if (info_func) {
1236-
info_func(tmp);
1237-
ZVAL_STRING(val, tmp);
1238-
}
1239-
#else
1240-
ZVAL_NULL(val);
1241-
#endif
1242-
}
1222+
case PDO_ATTR_CLIENT_VERSION:
1223+
isc_get_client_version(tmp);
1224+
ZVAL_STRING(val, tmp);
12431225
return 1;
12441226

12451227
case PDO_ATTR_SERVER_VERSION:

ext/pdo_firebird/php_pdo_firebird_int.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545
/* Firebird API has a couple of missing const decls in its API */
4646
#define const_cast(s) ((char*)(s))
4747

48-
#ifdef PHP_WIN32
49-
typedef void (__stdcall *info_func_t)(char*);
50-
#else
51-
typedef void (*info_func_t)(char*);
52-
#endif
53-
5448
#ifndef min
5549
#define min(a,b) ((a)<(b)?(a):(b))
5650
#endif

0 commit comments

Comments
 (0)